From f54470dab5b392380df61a22b4b4bef685b6cee2 Mon Sep 17 00:00:00 2001 From: Alan Coopersmith Date: Sat, 3 Aug 2019 19:09:19 -0700 Subject: Convert multiplying realloc calls to use reallocarray instead Signed-off-by: Alan Coopersmith --- test/utils/font-test-utils.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'test/utils/font-test-utils.c') diff --git a/test/utils/font-test-utils.c b/test/utils/font-test-utils.c index bc4039e..ff05061 100644 --- a/test/utils/font-test-utils.c +++ b/test/utils/font-test-utils.c @@ -53,6 +53,7 @@ SOFTWARE. */ #include "font-test-utils.h" +#include "src/util/replace.h" #include #include #include @@ -133,7 +134,8 @@ test_register_fpe_funcs(const xfont2_fpe_funcs_rec *funcs) xfont2_fpe_funcs_rec const **new; /* grow the list */ - new = realloc(fpe_functions, (num_fpe_types + 1) * sizeof(xfont2_fpe_funcs_ptr)); + new = reallocarray(fpe_functions, (num_fpe_types + 1), + sizeof(xfont2_fpe_funcs_ptr)); assert (new != NULL); fpe_functions = new; -- cgit v1.2.3