render / rpms / libvirt

Forked from rpms/libvirt 10 months ago
Clone
d76c62
From 93e06ede9932c53518c7b3c9bff01449f52e2be3 Mon Sep 17 00:00:00 2001
d76c62
Message-Id: <93e06ede9932c53518c7b3c9bff01449f52e2be3@dist-git>
d76c62
From: Peter Krempa <pkrempa@redhat.com>
d76c62
Date: Wed, 19 Feb 2020 15:09:54 +0100
d76c62
Subject: [PATCH] virDomainDiskAddISCSIPoolSourceHost: use g_new0 instead of
d76c62
 VIR_ALLOC_N
d76c62
MIME-Version: 1.0
d76c62
Content-Type: text/plain; charset=UTF-8
d76c62
Content-Transfer-Encoding: 8bit
d76c62
d76c62
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
d76c62
Reviewed-by: Ján Tomko <jtomko@redhat.com>
d76c62
(cherry picked from commit 5eda34f2e11f7ba4a26b0948dfa0fffa400dfadd)
d76c62
d76c62
https://bugzilla.redhat.com/show_bug.cgi?id=1804603
d76c62
Message-Id: <67e8bcdbcd5c9a22c75d6da6316a0d950664c2b8.1582120424.git.pkrempa@redhat.com>
d76c62
Reviewed-by: Ján Tomko <jtomko@redhat.com>
d76c62
---
d76c62
 src/conf/domain_conf.c | 4 +---
d76c62
 1 file changed, 1 insertion(+), 3 deletions(-)
d76c62
d76c62
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
d76c62
index 6973d97e1d..f0365329c6 100644
d76c62
--- a/src/conf/domain_conf.c
d76c62
+++ b/src/conf/domain_conf.c
d76c62
@@ -31186,9 +31186,7 @@ virDomainDiskAddISCSIPoolSourceHost(virDomainDiskDefPtr def,
d76c62
 
d76c62
     /* iscsi pool only supports one host */
d76c62
     def->src->nhosts = 1;
d76c62
-
d76c62
-    if (VIR_ALLOC_N(def->src->hosts, def->src->nhosts) < 0)
d76c62
-        goto cleanup;
d76c62
+    def->src->hosts = g_new0(virStorageNetHostDef, 1);
d76c62
 
d76c62
     def->src->hosts[0].name = g_strdup(pooldef->source.hosts[0].name);
d76c62
 
d76c62
-- 
d76c62
2.25.0
d76c62