loader: malloc+memset is calloc in spa_create

Replace malloc + memset pair with calloc.
This commit is contained in:
Toomas Soome 2019-05-29 07:33:51 +00:00
parent f28f385b9c
commit 93a2d4c92f
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=348354

View File

@ -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);