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>
tmpCaps = virQEMUCapsNew();
}
+ if (!tmpCaps)
+ return -1;
+
if (!virQEMUCapsHasMachines(tmpCaps)) {
const char *defaultRAMid = NULL;