From: Matthew Fernandez Date: Sun, 31 Jul 2022 16:06:12 +0000 (-0700) Subject: gvgen getCnt: fix unchecked allocation X-Git-Tag: 5.0.1~19^2~9 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=9a6f56d50044787aafcbe77f81a28cc76447a83b;p=graphviz gvgen getCnt: fix unchecked allocation --- diff --git a/cmd/tools/graph_generator.c b/cmd/tools/graph_generator.c index a8b9645fe..d8756de7e 100644 --- a/cmd/tools/graph_generator.c +++ b/cmd/tools/graph_generator.c @@ -290,7 +290,6 @@ constructSierpinski(int v1, int v2, int v3, int depth, vtx_data* graph) } #define NEW(t) calloc((1),sizeof(t)) -#define N_NEW(n,t) calloc((n),sizeof(t)) void makeSierpinski(int depth, edgefn ef) { @@ -648,7 +647,7 @@ static pair pop(gv_stack_t *sp) { static int* genCnt(int NN) { - int* T = N_NEW(NN+1,int); + int* T = gv_calloc(NN + 1, sizeof(int)); int D, I, J, TD; int SUM; int NLAST = 1;