mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-23 06:05:27 +00:00
qemu: Check if virQEMUCapsNewCopy(...) has failed
Check if virQEMUCapsNewCopy(...) has failed, thus a segmentation fault in virQEMUCapsFilterByMachineType(...) will be avoided. Signed-off-by: Marc Hartmayer <mhartmay@linux.vnet.ibm.com> Reviewed-by: Bjoern Walk <bwalk@linux.vnet.ibm.com>
This commit is contained in:
parent
728c0e5df4
commit
62b2c2fcdd
@ -4928,6 +4928,10 @@ virQEMUCapsCacheLookupCopy(virCapsPtr caps,
|
||||
|
||||
ret = virQEMUCapsNewCopy(qemuCaps);
|
||||
virObjectUnref(qemuCaps);
|
||||
|
||||
if (!ret)
|
||||
return NULL;
|
||||
|
||||
virQEMUCapsFilterByMachineType(ret, machineType);
|
||||
return ret;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user