mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-23 06:05:27 +00: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:
parent
3446750bab
commit
fd754cb69c
@ -2965,7 +2965,7 @@ virQEMUCapsFetchCPUDefinitions(qemuMonitorPtr mon)
|
|||||||
size_t i;
|
size_t i;
|
||||||
|
|
||||||
if ((ncpus = qemuMonitorGetCPUDefinitions(mon, &cpus)) < 0)
|
if ((ncpus = qemuMonitorGetCPUDefinitions(mon, &cpus)) < 0)
|
||||||
goto error;
|
return NULL;
|
||||||
|
|
||||||
if (!(models = virDomainCapsCPUModelsNew(ncpus)))
|
if (!(models = virDomainCapsCPUModelsNew(ncpus)))
|
||||||
goto error;
|
goto error;
|
||||||
|
Loading…
Reference in New Issue
Block a user