提交 aef96949 编写于 作者: M Matthias Bolte

qemu: Don't allocate zero bytes

上级 21c84e00
...@@ -836,6 +836,8 @@ qemudCapsInitGuest(virCapsPtr caps, ...@@ -836,6 +836,8 @@ qemudCapsInitGuest(virCapsPtr caps,
return -1; return -1;
} }
nmachines = 1;
if (VIR_ALLOC_N(machines, nmachines) < 0) { if (VIR_ALLOC_N(machines, nmachines) < 0) {
virReportOOMError(NULL); virReportOOMError(NULL);
VIR_FREE(machine->name); VIR_FREE(machine->name);
...@@ -844,7 +846,6 @@ qemudCapsInitGuest(virCapsPtr caps, ...@@ -844,7 +846,6 @@ qemudCapsInitGuest(virCapsPtr caps,
} }
machines[0] = machine; machines[0] = machine;
nmachines = 1;
} else { } else {
int probe = 1; int probe = 1;
if (old_caps && binary_mtime) if (old_caps && binary_mtime)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册