loader: malloc+memset is calloc in spa_create
Replace malloc + memset pair with calloc.
This commit is contained in:
parent
f28f385b9c
commit
93a2d4c92f
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=348354
@ -750,9 +750,8 @@ spa_create(uint64_t guid, const char *name)
|
||||
{
|
||||
spa_t *spa;
|
||||
|
||||
if ((spa = malloc(sizeof(spa_t))) == NULL)
|
||||
if ((spa = calloc(1, sizeof(spa_t))) == NULL)
|
||||
return (NULL);
|
||||
memset(spa, 0, sizeof(spa_t));
|
||||
if ((spa->spa_name = strdup(name)) == NULL) {
|
||||
free(spa);
|
||||
return (NULL);
|
||||
|
Loading…
Reference in New Issue
Block a user