mirror of
https://github.com/opnsense/src.git
synced 2026-06-09 00:32:25 -04:00
Use stdup(3) and check its return instead from homebrew version using strcpy(3)
and malloc(3) Obtained from: NetBSD
This commit is contained in:
parent
8916ff53c3
commit
0a2963a2ac
1 changed files with 2 additions and 1 deletions
|
|
@ -574,7 +574,8 @@ addmac(const char *mac)
|
|||
dest = src+1;
|
||||
while (dest > loc)
|
||||
*dest-- = *src--;
|
||||
*loc = strcpy(malloc(3), mac);
|
||||
if ((*loc = strdup(mac)) == NULL)
|
||||
err(1, "strdup");
|
||||
ncmds++;
|
||||
#ifdef DEBUG
|
||||
printf("after: %s %s %s %s %s, %d cmds\n",
|
||||
|
|
|
|||
Loading…
Reference in a new issue