]> granicus.if.org Git - graphviz/commitdiff
gvpr: fix unchecked allocation failure in 'parseArgs'
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Sat, 2 Jul 2022 15:35:46 +0000 (08:35 -0700)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Mon, 4 Jul 2022 22:19:11 +0000 (15:19 -0700)
lib/gvpr/gvpr.c

index 68032edb6679eb807a920d5d9e7a89dc1da79e3a..8f8de2cb73fc8d3efe74da05ffcd321411a6f49e 100644 (file)
@@ -19,6 +19,7 @@
 #include "builddate.h"
 #include <gvpr/gprstate.h>
 #include <cgraph/agxbuf.h>
+#include <cgraph/alloc.h>
 #include <cgraph/cgraph.h>
 #include <cgraph/exit.h>
 #include <cgraph/stack.h>
@@ -166,7 +167,7 @@ static int parseArgs(char *s, int argc, char ***argv)
        argc = oldcnt + cnt;
        av = oldof(*argv, char *, argc, 0);
        for (i = 0; i < cnt; i++)
-           av[oldcnt + i] = strdup(args[i]);
+           av[oldcnt + i] = gv_strdup(args[i]);
        *argv = av;
     }
     return argc;