From: Peter Krempa Date: Wed, 5 Feb 2020 11:27:18 +0000 (+0100) Subject: virDomainDiskAddISCSIPoolSourceHost: use g_new0 instead of VIR_ALLOC_N X-Git-Tag: v6.1.0-rc1~190 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5eda34f2e11f7ba4a26b0948dfa0fffa400dfadd;p=thirdparty%2Flibvirt.git virDomainDiskAddISCSIPoolSourceHost: use g_new0 instead of VIR_ALLOC_N Signed-off-by: Peter Krempa Reviewed-by: Ján Tomko --- diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index a1458c0345..926dbcd854 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -31341,9 +31341,7 @@ virDomainDiskAddISCSIPoolSourceHost(virDomainDiskDefPtr def, /* iscsi pool only supports one host */ def->src->nhosts = 1; - - if (VIR_ALLOC_N(def->src->hosts, def->src->nhosts) < 0) - goto cleanup; + def->src->hosts = g_new0(virStorageNetHostDef, 1); def->src->hosts[0].name = g_strdup(pooldef->source.hosts[0].name);