From: Matthew Fernandez Date: Sat, 27 Aug 2022 15:49:00 +0000 (-0700) Subject: cgraph concatPort: fix unchecked allocation failure X-Git-Tag: 6.0.1~19^2~1 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=f8d24e346906523679454181a45cf96988818276;p=graphviz cgraph concatPort: fix unchecked allocation failure --- diff --git a/lib/cgraph/grammar.y b/lib/cgraph/grammar.y index 800a99779..e124956f5 100644 --- a/lib/cgraph/grammar.y +++ b/lib/cgraph/grammar.y @@ -459,7 +459,7 @@ concatPort (char* s1, char* s2) size_t len = strlen(s1) + strlen(s2) + 2; /* one more for ':' */ if (len <= BUFSIZ) sym = buf; - else sym = malloc(len); + else sym = gv_alloc(len); sprintf (sym, "%s:%s", s1, s2); s = agstrdup (G,sym); agstrfree (G,s1);