From: Matthew Fernandez Date: Fri, 2 Sep 2022 00:46:47 +0000 (-0700) Subject: smyrna add_column: fix unchecked allocation failure X-Git-Tag: 6.0.1~13^2~27 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=3a2f450f4e6bd3ed4cf5f29d830944709f1a9f7b;p=graphviz smyrna add_column: fix unchecked allocation failure --- diff --git a/cmd/smyrna/tvnodes.c b/cmd/smyrna/tvnodes.c index 5ba7a3b9b..ad7fbc0be 100644 --- a/cmd/smyrna/tvnodes.c +++ b/cmd/smyrna/tvnodes.c @@ -11,6 +11,7 @@ #include "tvnodes.h" #include "viewport.h" #include "topviewfuncs.h" +#include #include #include @@ -309,8 +310,8 @@ static void add_column(grid * g, char *name, bool editable, GType g_type) { if (*name == '\0') return; - g->columns = realloc(g->columns, - sizeof(gridCol *) * (g->count + 1)); + g->columns = gv_recalloc(g->columns, g->count, g->count + 1, + sizeof(gridCol*)); g->columns[g->count] = NEW(gridCol); g->columns[g->count]->editable = editable; g->columns[g->count]->name = name;