]> granicus.if.org Git - graphviz/commitdiff
glcomp glCompSetAddNewTexLabel: fix unchecked allocation failures
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Sat, 17 Sep 2022 00:27:26 +0000 (17:27 -0700)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Wed, 21 Sep 2022 00:17:10 +0000 (17:17 -0700)
lib/glcomp/glcomptexture.c

index 05a170fc838b041e103618b675c53402fcd44fc2..1d9fce0b2b41f424e5425a607633686036220afc 100644 (file)
@@ -12,8 +12,6 @@
 #include <glcomp/glcomptexture.h>
 #include <glcomp/glpangofont.h>
 
-#include <common/memory.h>
-
 static glCompTex *glCompSetAddNewTexture(glCompSet * s, int width,
                                         int height, unsigned char *data,
                                         int is2D)
@@ -136,8 +134,8 @@ glCompTex *glCompSetAddNewTexLabel(glCompSet * s, char *def, int fs,
        return NULL;
     }
 
-    t->def = strdup(def);
-    t->text = strdup(text);
+    t->def = gv_strdup(def);
+    t->text = gv_strdup(text);
     t->type = glTexLabel;
     return t;
 }