1
0
mirror of https://gitlab.com/libvirt/libvirt.git synced 2025-04-01 20:05:19 +00:00

virDomainDiskAddISCSIPoolSourceHost: use g_new0 instead of VIR_ALLOC_N

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
Peter Krempa 2020-02-05 12:27:18 +01:00
parent c5b1c14379
commit 5eda34f2e1

View File

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