]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
qemu: Don't allocate zero bytes
authorMatthias Bolte <matthias.bolte@googlemail.com>
Tue, 19 Jan 2010 21:39:37 +0000 (22:39 +0100)
committerMatthias Bolte <matthias.bolte@googlemail.com>
Wed, 20 Jan 2010 21:50:35 +0000 (22:50 +0100)
src/qemu/qemu_conf.c

index 38eb3fd8c68b258c10dc7a2b85b8a3092fb98ac9..47732aba7bb7e476591fe68aeef605848d8f0b1d 100644 (file)
@@ -836,6 +836,8 @@ qemudCapsInitGuest(virCapsPtr caps,
             return -1;
         }
 
+        nmachines = 1;
+
         if (VIR_ALLOC_N(machines, nmachines) < 0) {
             virReportOOMError(NULL);
             VIR_FREE(machine->name);
@@ -844,7 +846,6 @@ qemudCapsInitGuest(virCapsPtr caps,
         }
 
         machines[0] = machine;
-        nmachines = 1;
     } else {
         int probe = 1;
         if (old_caps && binary_mtime)