From 46ec12fd66844820c11dbe8d1991682196ca5f20 Mon Sep 17 00:00:00 2001 From: Matthew Fernandez Date: Sat, 27 Aug 2022 15:30:16 -0700 Subject: [PATCH] gvpr scanArgs: fix unchecked allocation failure --- lib/gvpr/gvpr.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) 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; -- 2.40.0