mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-22 21:55:25 +00:00
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:
parent
c0e65398d9
commit
e09c852782
@ -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",
|
||||
|
Loading…
Reference in New Issue
Block a user