From 454b2ea38a8873c9d04dfafc90d0be227d96b65f Mon Sep 17 00:00:00 2001 From: Matthew Fernandez Date: Sat, 27 Aug 2022 08:48:37 -0700 Subject: [PATCH] cgraph concat: fix unchecked allocation failure --- lib/cgraph/grammar.y | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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); -- 2.40.0