mirror of
https://github.com/libvirt/libvirt.git
synced 2026-10-02 12:20:06 -05: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:
1 parent
3446750bab
commit
fd754cb69c
1 file changed
+1
-1
@@ -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