From: Matthew Fernandez Date: Sat, 15 Oct 2022 18:13:13 +0000 (-0700) Subject: common emit_colors: fix unchecked allocation failures X-Git-Tag: 7.0.0~3^2~2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=2b714536206fb9448a33e47268d14bd2973015e5;p=graphviz common emit_colors: fix unchecked allocation failures --- diff --git a/lib/common/emit.c b/lib/common/emit.c index 3d6a7f541..97a473d77 100644 --- a/lib/common/emit.c +++ b/lib/common/emit.c @@ -3272,7 +3272,7 @@ static void emit_colors(GVJ_t * job, graph_t * g) gvrender_set_fillcolor(job, str); if (((str = agget(n, "fillcolor")) != 0) && str[0]) { if (strchr(str, ':')) { - colors = strdup(str); + colors = gv_strdup(str); for (str = strtok(colors, ":"); str; str = strtok(0, ":")) { if (str[0]) @@ -3289,7 +3289,7 @@ static void emit_colors(GVJ_t * job, graph_t * g) for (e = agfstout(g, n); e; e = agnxtout(g, e)) { if (((str = agget(e, "color")) != 0) && str[0]) { if (strchr(str, ':')) { - colors = strdup(str); + colors = gv_strdup(str); for (str = strtok(colors, ":"); str; str = strtok(0, ":")) { if (str[0])