From: Matthew Fernandez Date: Fri, 2 Sep 2022 01:57:58 +0000 (-0700) Subject: smyrna load_attributes: use cgraph wrapper for allocation X-Git-Tag: 6.0.1~13^2~1 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=ca3dfbe95dc57ace3ca5bda83f809846a17807c5;p=graphviz smyrna load_attributes: use cgraph wrapper for allocation The lib/cgraph/alloc.h wrappers are similar to the older lib/common/memory.h wrappers except (1) they are header-only and (2) they live in a directory (cgraph) that is at the root of the dependency tree. The long term plan is to replace all use of lib/common/memory.h with lib/cgraph/alloc.h. --- diff --git a/cmd/smyrna/gui/gui.c b/cmd/smyrna/gui/gui.c index c82863f9f..346f0cd67 100644 --- a/cmd/smyrna/gui/gui.c +++ b/cmd/smyrna/gui/gui.c @@ -15,8 +15,8 @@ #include #include #include "viewport.h" +#include #include -#include GladeXML *xml; //global libglade vars GtkWidget *gladewidget; @@ -90,9 +90,10 @@ void load_attributes(void) } break; default: - attr[attrcount].ComboValues = - RALLOC(attr[attrcount].ComboValuesCount, - attr[attrcount].ComboValues, char *); + attr[attrcount].ComboValues = gv_recalloc(attr[attrcount].ComboValues, + attr[attrcount].ComboValuesCount - 1, + attr[attrcount].ComboValuesCount, + sizeof(char*)); attr[attrcount].ComboValues[attr[attrcount]. ComboValuesCount] = strview_str(ss); attr[attrcount].ComboValuesCount++;