From: Matthew Fernandez Date: Mon, 15 Jun 2020 23:16:36 +0000 (-0700) Subject: refactor a GNEW call that can tolerate failure into a direct malloc X-Git-Tag: 2.44.1~5^2~15 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=608e0e251b59e8ca6cddd00e9094fc84579239b6;p=graphviz refactor a GNEW call that can tolerate failure into a direct malloc We are about to make the GNEW wrapper exit on allocation failure, so this preserves the existing semantics of allocation failure being non-fatal to this call. This is the only GNEW call I can see that can tolerate allocation failure. --- diff --git a/lib/pack/ccomps.c b/lib/pack/ccomps.c index 9f8d27c96..196239ed4 100644 --- a/lib/pack/ccomps.c +++ b/lib/pack/ccomps.c @@ -14,6 +14,7 @@ #include #include +#include #include "render.h" #include "pack.h" @@ -74,7 +75,7 @@ static void push(stk_t* sp, Agnode_t * np) { if (sp->curp == sp->curblk->endp) { if (sp->curblk->next == NULL) { - blk_t *bp = GNEW(blk_t); + blk_t *bp = malloc(sizeof(blk_t)); if (bp == 0) { agerr(AGERR, "gc: Out of memory\n"); longjmp(jbuf, 1);