Blame SOURCES/libvirt-virDomainDiskAddISCSIPoolSourceHost-use-g_new0-instead-of-VIR_ALLOC_N.patch

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