From: Matthew Fernandez Date: Sat, 27 Aug 2022 22:30:16 +0000 (-0700) Subject: gvpr scanArgs: fix unchecked allocation failure X-Git-Tag: 6.0.1~18^2~2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=46ec12fd66844820c11dbe8d1991682196ca5f20;p=graphviz gvpr scanArgs: fix unchecked allocation failure --- diff --git a/lib/gvpr/gvpr.c b/lib/gvpr/gvpr.c index b5cacd47f..aee9a484f 100644 --- a/lib/gvpr/gvpr.c +++ b/lib/gvpr/gvpr.c @@ -375,7 +375,6 @@ static void freeOpts(options opts) { */ static options scanArgs(int argc, char **argv) { int i, nfiles; - char** input_filenames; char* arg; options opts = {0}; @@ -390,7 +389,7 @@ static options scanArgs(int argc, char **argv) { for (i = 1; i < argc; i++) if (argv[i] && argv[i][0] != '-') nfiles++; - input_filenames = newof(0,char*,nfiles + 1,0); + char** input_filenames = gv_calloc(nfiles + 1, sizeof(char*)); /* loop over arguments */ nfiles = 0;