From 4b9ea6b39a9463b827bdab719201daaa8926bc1e Mon Sep 17 00:00:00 2001 From: Matthew Fernandez Date: Thu, 13 Oct 2022 21:02:41 -0700 Subject: [PATCH] common make_label: fix unchecked allocation failures --- lib/common/labels.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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)) { -- 2.40.0