1
0
mirror of https://gitlab.com/libvirt/libvirt.git synced 2024-12-22 17:34:18 +03:00

testsutilsqemu: check return value of virQEMUCapsNewCopy

While for virQEMUCapsNew this should not be needed
(the possible failures in VIR_CLASS_NEW are only hit
 on bad API usage which we don't do here),
virQEMUCapsNewCopy calls into many other functions,
some of which actually fail.

Check the return value of both.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
This commit is contained in:
Ján Tomko 2020-11-20 13:39:37 +01:00
parent 5c028697cd
commit bac69aa1f9

View File

@ -349,6 +349,9 @@ int qemuTestCapsCacheInsert(virFileCachePtr cache,
tmpCaps = virQEMUCapsNew();
}
if (!tmpCaps)
return -1;
if (!virQEMUCapsHasMachines(tmpCaps)) {
const char *defaultRAMid = NULL;