From 2b714536206fb9448a33e47268d14bd2973015e5 Mon Sep 17 00:00:00 2001 From: Matthew Fernandez Date: Sat, 15 Oct 2022 11:13:13 -0700 Subject: [PATCH] common emit_colors: fix unchecked allocation failures --- lib/common/emit.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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]) -- 2.40.0