From 8a1408ee1cb378da924b7e012ff082238d073e21 Mon Sep 17 00:00:00 2001 From: Matthew Fernandez <matthew.fernandez@gmail.com> Date: Sat, 15 Oct 2022 11:01:50 -0700 Subject: [PATCH] common initMapData: fix unchecked allocation failure --- lib/common/emit.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/common/emit.c b/lib/common/emit.c index 4874975c9..8fd39de19 100644 --- a/lib/common/emit.c +++ b/lib/common/emit.c @@ -24,6 +24,7 @@ #include <math.h> #include <common/render.h> #include <cgraph/agxbuf.h> +#include <cgraph/alloc.h> #include <cgraph/unreachable.h> #include <common/htmltable.h> #include <gvc/gvc.h> @@ -169,7 +170,7 @@ initMapData (GVJ_t* job, char* lbl, char* url, char* tooltip, char* target, char assigned = 1; } else if (obj->label) { - obj->tooltip = strdup(obj->label); + obj->tooltip = gv_strdup(obj->label); assigned = 1; } } -- 2.40.0