]> granicus.if.org Git - graphviz/commitdiff
edgepaint: replace a 'strdup' with 'gv_strdup'
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Thu, 17 Mar 2022 04:22:48 +0000 (21:22 -0700)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Thu, 24 Mar 2022 15:36:53 +0000 (08:36 -0700)
This allocation was not handling failure and the only reasonable response here
is to exit.

cmd/edgepaint/edgepaintmain.c

index f5f223c61bb03c28e64d7f25038781debbcf80dd..7bc307cdf7df43103ed9eee660e66fe81cad8a6c 100644 (file)
@@ -10,6 +10,7 @@
 
 #include "config.h"
 
+#include <cgraph/alloc.h>
 #include <cgraph/cgraph.h>
 #include <cgraph/agxbuf.h>
 #include <cgraph/exit.h>
@@ -229,7 +230,7 @@ static void init(int argc, char *argv[], double *angle, double *accuracy, int *c
         usage(cmd, EXIT_FAILURE);
       }
       free(*lightness);
-      *lightness = strdup(arg);
+      *lightness = gv_strdup(arg);
       break;
     }