mirror of
https://github.com/opnsense/src.git
synced 2026-04-15 14:29:58 -04:00
units(1): use common functions
No need to replicate strdup
This commit is contained in:
parent
0c50edff52
commit
cfa8c23640
1 changed files with 2 additions and 3 deletions
|
|
@ -111,10 +111,9 @@ dupstr(const char *str)
|
|||
{
|
||||
char *ret;
|
||||
|
||||
ret = malloc(strlen(str) + 1);
|
||||
ret = strdup(str);
|
||||
if (!ret)
|
||||
errx(3, "memory allocation error");
|
||||
strcpy(ret, str);
|
||||
err(3, "dupstr");
|
||||
return (ret);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue