From: Matthew Fernandez Date: Fri, 14 Oct 2022 04:02:41 +0000 (-0700) Subject: common make_label: fix unchecked allocation failures X-Git-Tag: 7.0.0~4^2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=4b9ea6b39a9463b827bdab719201daaa8926bc1e;p=graphviz common make_label: fix unchecked allocation failures --- diff --git a/lib/common/labels.c b/lib/common/labels.c index 05d8bd498..f4d9cc819 100644 --- a/lib/common/labels.c +++ b/lib/common/labels.c @@ -9,6 +9,7 @@ *************************************************************************/ #include +#include #include #include #include @@ -137,13 +138,13 @@ textlabel_t *make_label(void *obj, char *str, int kind, double fontsize, char *f rv->fontsize = fontsize; rv->charset = GD_charset(g); if (kind & LT_RECD) { - rv->text = strdup(str); + rv->text = gv_strdup(str); if (kind & LT_HTML) { rv->html = true; } } else if (kind == LT_HTML) { - rv->text = strdup(str); + rv->text = gv_strdup(str); rv->html = true; if (make_html_label(obj, rv)) { switch (agobjkind(obj)) {