From: Jiri Denemark Date: Mon, 11 Dec 2017 13:34:20 +0000 (+0100) Subject: qemu: Avoid comparing size_t with -1 X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=fd754cb69cb073d370d73b9eab65db8ce1400096;p=libvirt.git qemu: Avoid comparing size_t with -1 ncpus would be -1 on error and the cleanup for loop would not be skipped in this case. Signed-off-by: Jiri Denemark Reviewed-by: John Ferlan --- diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index 8c65de956e..9673ef857b 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -2965,7 +2965,7 @@ virQEMUCapsFetchCPUDefinitions(qemuMonitorPtr mon) size_t i; if ((ncpus = qemuMonitorGetCPUDefinitions(mon, &cpus)) < 0) - goto error; + return NULL; if (!(models = virDomainCapsCPUModelsNew(ncpus))) goto error;