From: Matthew Fernandez Date: Sat, 27 Aug 2022 15:48:37 +0000 (-0700) Subject: cgraph concat: fix unchecked allocation failure X-Git-Tag: 6.0.1~19^2~2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=454b2ea38a8873c9d04dfafc90d0be227d96b65f;p=graphviz cgraph concat: fix unchecked allocation failure --- diff --git a/lib/cgraph/grammar.y b/lib/cgraph/grammar.y index 943ba2783..800a99779 100644 --- a/lib/cgraph/grammar.y +++ b/lib/cgraph/grammar.y @@ -21,6 +21,7 @@ #include #include #include +#include #include #include extern void aagerror(const char*); @@ -437,7 +438,7 @@ concat (char* s1, char* s2) size_t len = strlen(s1) + strlen(s2) + 1; if (len <= BUFSIZ) sym = buf; - else sym = malloc(len); + else sym = gv_alloc(len); strcpy(sym,s1); strcat(sym,s2); s = agstrdup (G,sym);