]> granicus.if.org Git - graphviz/commitdiff
common initMapData: fix unchecked allocation failure
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Sat, 15 Oct 2022 18:01:50 +0000 (11:01 -0700)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Wed, 19 Oct 2022 04:30:58 +0000 (21:30 -0700)
lib/common/emit.c

index 4874975c9ae0872ef3f6670bf588eca2995da396..8fd39de19bebe8dac5a0c1b9aec09a497935c135 100644 (file)
@@ -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;
         }
     }