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

index 97a473d770b00ab371e97d433c196d3bfa1d1746..94099265fc5efd2b9d74d411fd228ed568d59b3e 100644 (file)
@@ -3539,7 +3539,7 @@ int emit_once(char *str)
     if (strings == 0)
        strings = dtopen(&stringdict, Dtoset);
     if (!dtsearch(strings, str)) {
-       dtinsert(strings, strdup(str));
+       dtinsert(strings, gv_strdup(str));
        return TRUE;
     }
     return FALSE;