[libvirt PATCH 2/4] tests: cpuTestLoadMultiXML: use g_new0 instead of VIR_ALLOC_N

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Signed-off-by: Ján Tomko <jtomko@xxxxxxxxxx>
---
 tests/cputest.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/tests/cputest.c b/tests/cputest.c
index 83d63bf495..383da94938 100644
--- a/tests/cputest.c
+++ b/tests/cputest.c
@@ -111,11 +111,13 @@ cpuTestLoadMultiXML(virArch arch,
         goto cleanup;
 
     n = virXPathNodeSet("/cpuTest/cpu", ctxt, &nodes);
-    if (n <= 0 || (VIR_ALLOC_N(cpus, n) < 0)) {
+    if (n <= 0) {
         fprintf(stderr, "\nNo /cpuTest/cpu elements found in %s\n", xml);
         goto cleanup;
     }
 
+    cpus = g_new0(virCPUDefPtr, n);
+
     for (i = 0; i < n; i++) {
         ctxt->node = nodes[i];
         if (virCPUDefParseXML(ctxt, NULL, VIR_CPU_TYPE_HOST, &cpus[i]) < 0)
-- 
2.26.2




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux