Skip to content

Commit

Permalink
Check malloc() result in ss_execute_command()
Browse files Browse the repository at this point in the history
Reported by Bean Zhang.
  • Loading branch information
greghudson committed Aug 30, 2018
1 parent c0af219 commit 80a6890
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/util/ss/execute_cmd.c
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,8 @@ ss_execute_command(sci_idx, argv)
for (argp = argv; *argp; argp++)
argc++;
argp = (char **)malloc((argc+1)*sizeof(char *));
if (argp == NULL)
return(ENOMEM);
for (i = 0; i <= argc; i++)
argp[i] = argv[i];
ret = really_execute_command(sci_idx, argc, &argp);
Expand Down

0 comments on commit 80a6890

Please sign in to comment.