From aef969499f0175500cfc25b4f2650d41895936c6 Mon Sep 17 00:00:00 2001 From: Matthias Bolte Date: Tue, 19 Jan 2010 22:39:37 +0100 Subject: [PATCH] qemu: Don't allocate zero bytes --- src/qemu/qemu_conf.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/qemu/qemu_conf.c b/src/qemu/qemu_conf.c index 38eb3fd8c6..47732aba7b 100644 --- a/src/qemu/qemu_conf.c +++ b/src/qemu/qemu_conf.c @@ -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) -- 2.47.2