Skip to content

Commit

Permalink
check if allocation was successful
Browse files Browse the repository at this point in the history
See #4274
  • Loading branch information
reinerh committed May 13, 2021
1 parent 9fca450 commit 0783f9f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/firejail/sbox.c
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,9 @@ int sbox_run(unsigned filtermask, int num, ...) {
va_start(valist, num);

// build argument list
char **arg = malloc((num + 1) * sizeof(char *));
char **arg = calloc(num + 1, sizeof(char *));
if (!arg)
errExit("calloc");
int i;
for (i = 0; i < num; i++)
arg[i] = va_arg(valist, char *);
Expand Down

0 comments on commit 0783f9f

Please sign in to comment.