mirror of
https://github.com/libvirt/libvirt.git
synced 2025-02-25 18:55:26 -06:00
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 <jdenemar@redhat.com> Reviewed-by: John Ferlan <jferlan@redhat.com>
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user