From: Matthew Fernandez Date: Fri, 14 Oct 2022 04:02:24 +0000 (-0700) Subject: common make_html_label: fix unchecked allocation failures X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=6cbd32c747a05340450477d526ec1c9e75f505f6;p=graphviz common make_html_label: fix unchecked allocation failures --- diff --git a/lib/common/htmltable.c b/lib/common/htmltable.c index 98b0b22fb..e5d4ab242 100644 --- a/lib/common/htmltable.c +++ b/lib/common/htmltable.c @@ -2015,7 +2015,7 @@ int make_html_label(void *obj, textlabel_t * lp) char buf[SMALLBUF]; agxbinit(&xb, SMALLBUF, buf); lp->html = false; - lp->text = strdup(nameOf(obj, &xb)); + lp->text = gv_strdup(nameOf(obj, &xb)); switch (lp->charset) { case CHAR_LATIN1: s = latin1ToUTF8(lp->text); @@ -2033,7 +2033,7 @@ int make_html_label(void *obj, textlabel_t * lp) if (lbl->kind == HTML_TBL) { if (!lbl->u.tbl->data.pencolor && getPenColor(obj)) - lbl->u.tbl->data.pencolor = strdup(getPenColor(obj)); + lbl->u.tbl->data.pencolor = gv_strdup(getPenColor(obj)); rv |= size_html_tbl(g, lbl->u.tbl, NULL, &env); wd2 = lbl->u.tbl->data.box.UR.x / 2; ht2 = lbl->u.tbl->data.box.UR.y / 2; @@ -2058,7 +2058,7 @@ int make_html_label(void *obj, textlabel_t * lp) */ if (lbl->kind == HTML_TBL) { free(lp->text); - lp->text = strdup(""); + lp->text = gv_strdup("
"); } return rv;