From: Matthew Fernandez Date: Sun, 31 Jul 2022 16:05:06 +0000 (-0700) Subject: gvgen makeTetrix: fix unchecked allocations X-Git-Tag: 5.0.1~19^2~11 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=bae6b8cda1639e3ee8238b352a79c74dace6063e;p=graphviz gvgen makeTetrix: fix unchecked allocations --- diff --git a/cmd/tools/graph_generator.c b/cmd/tools/graph_generator.c index e7c344558..10f4013bc 100644 --- a/cmd/tools/graph_generator.c +++ b/cmd/tools/graph_generator.c @@ -386,8 +386,8 @@ void makeTetrix(int depth, edgefn ef) depth--; n = 4 + 2 * (((int) (pow(4.0, (double) depth) + 0.5) - 1)); - graph = N_NEW(n + 1, vtx_data); - edges = N_NEW(6 * n, int); + graph = gv_calloc(n + 1, sizeof(vtx_data)); + edges = gv_calloc(6 * n, sizeof(int)); for (i = 1; i <= n; i++) { graph[i].edges = edges;