From: Matthew Fernandez Date: Tue, 17 May 2022 14:25:44 +0000 (-0700) Subject: tred: replace a 'malloc' with cgraph alloc wrapper X-Git-Tag: 4.0.0~9^2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=8dd2599f6b9b151473c9aee77c0fe473d617545b;p=graphviz tred: replace a 'malloc' with cgraph alloc wrapper This addresses a case where allocation failure went unchecked. --- diff --git a/cmd/tools/tred.c b/cmd/tools/tred.c index 207843395..a860f2ee1 100644 --- a/cmd/tools/tred.c +++ b/cmd/tools/tred.c @@ -22,6 +22,7 @@ * transitive reduction on stdout */ +#include #include #include #include @@ -232,7 +233,7 @@ static void process(Agraph_t *g, gv_stack_t *sp) { size_t infosize; infosize = (agnnodes(g)+1)*sizeof(nodeinfo_t); - ninfo = malloc(infosize); + ninfo = gv_alloc(infosize); if (Verbose) fprintf(stderr, "Processing graph %s\n", agnameof(g));