Skip to content

Commit

Permalink
mamake: use duplicate(), not strdup(3) (re: f58153d)
Browse files Browse the repository at this point in the history
  • Loading branch information
McDutchie committed Jan 15, 2025
1 parent fb3fc47 commit 4936d62
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/cmd/INIT/mamake.c
Original file line number Diff line number Diff line change
Expand Up @@ -1029,8 +1029,8 @@ static void substitute(Buf_t *buf, char *s)
while (*q && !isspace(*q))
q++;
n++;
c = *q, *q = 0; /* terminate for strdup */
if (!(argv = realloc(argv, (n+1)*sizeof(char*))) || !(argv[n-1] = strdup(a)))
c = *q, *q = 0; /* terminate for duplicate() */
if (!(argv = realloc(argv, (n+1)*sizeof(char*))) || !(argv[n-1] = duplicate(a)))
out_of_memory();
*q = c;
}
Expand Down

0 comments on commit 4936d62

Please sign in to comment.