Use calloc instead of malloc + memset
MFC after: 3 days Sponsored by: Dell EMC Isilon
This commit is contained in:
parent
9f825b1b1d
commit
73dcfb8ddc
@ -87,10 +87,9 @@ parse(char *arg, char **param, char **value, int *len)
|
||||
return (EINVAL);
|
||||
if (*len <= 0 || *len > PATH_MAX)
|
||||
return (EINVAL);
|
||||
*value = malloc(*len);
|
||||
*value = calloc(*len, sizeof(char));
|
||||
if (*value == NULL)
|
||||
return (ENOMEM);
|
||||
memset(*value, 0, *len);
|
||||
if (equal != NULL) {
|
||||
if (strlen(equal) >= PATH_MAX)
|
||||
return (ENOMEM);
|
||||
|
Loading…
Reference in New Issue
Block a user