From: Matthew Fernandez Date: Sat, 11 Sep 2021 18:12:51 +0000 (-0700) Subject: gvpr compileProg: remove now unnecessary 'strdup' X-Git-Tag: 2.49.1~14^2~7 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=b30f87ae2589d22ae117b9e15f76cc128dad29e1;p=graphviz gvpr compileProg: remove now unnecessary 'strdup' Now that the backing memory for `endgsfx` is no longer hosted in a temporary sfio buffer that may be overwritten, there is no need to duplicate this further. --- diff --git a/lib/gvpr/compile.c b/lib/gvpr/compile.c index 99a88c00f..e5f3fa52d 100644 --- a/lib/gvpr/compile.c +++ b/lib/gvpr/compile.c @@ -2441,7 +2441,7 @@ comp_prog *compileProg(parse_prog * inp, Gpr_t * state, int flags) { comp_prog *p; Sfio_t *tmps = state->tmp; - char *endg_sfx = 0; + const char *endg_sfx = NULL; int i, useflags = 0; /* Initialize default io */ @@ -2458,7 +2458,7 @@ comp_prog *compileProg(parse_prog * inp, Gpr_t * state, int flags) } if (flags) { - endg_sfx = strdup (doFlags(flags)); + endg_sfx = doFlags(flags); } if (!initDisc(state)) @@ -2522,7 +2522,6 @@ comp_prog *compileProg(parse_prog * inp, Gpr_t * state, int flags) freeCompileProg (p); p = 0; } - free (endg_sfx); return p; }