Fix malloc error

This commit is contained in:
Radon Rosborough 2021-08-12 20:34:15 -07:00
parent b6b98c9919
commit cf7e5c470b
1 changed files with 1 additions and 0 deletions

View File

@ -65,6 +65,7 @@ char *quoteArgs(int argc, char **cmdline)
len_total += len_read;
if (len_allocated - len_total < 1024) {
char *new_buf = malloc(len_allocated + 1024);
len_allocated += 1024;
if (new_buf == NULL)
die("malloc failed");
memcpy(new_buf, buf, len_total);