virVBoxSnapshotConfSaveVboxFile: abort() on failure to allocate xmlDoc and comment

'xmlNewDoc' and 'xmlNewDocComment' return NULL only on allocation
failure. Attempting to raise an error is pointless.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Laine Stump <laine@redhat.com>
This commit is contained in:
Peter Krempa 2021-02-24 11:28:56 +01:00
parent c0e65398d9
commit e09c852782

View File

@ -996,10 +996,8 @@ virVBoxSnapshotConfSaveVboxFile(virVBoxSnapshotConfMachinePtr machine,
goto cleanup;
}
xml = xmlNewDoc(BAD_CAST "1.0");
if (!xml) {
virReportOOMError();
goto cleanup;
}
if (!xml)
abort();
cur = virXMLNewNode(NULL, "VirtualBox");
@ -1023,10 +1021,8 @@ virVBoxSnapshotConfSaveVboxFile(virVBoxSnapshotConfMachinePtr machine,
"OVERWRITTEN AND LOST.\n"
"Changes to this xml configuration should be made using Virtualbox\n"
"or other application using the libvirt API");
if (!cur) {
virReportOOMError();
goto cleanup;
}
if (!cur)
abort();
if (!xmlAddPrevSibling(xmlDocGetRootElement(xml), cur)) {
virReportError(VIR_ERR_XML_ERROR, "%s",