From: Peter Krempa Date: Wed, 24 Feb 2021 10:28:56 +0000 (+0100) Subject: virVBoxSnapshotConfSaveVboxFile: abort() on failure to allocate xmlDoc and comment X-Git-Tag: v7.2.0-rc1~272 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e09c8527823673d65531a6d1ccd12a7cd9742ddd;p=thirdparty%2Flibvirt.git 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 Reviewed-by: Laine Stump --- diff --git a/src/vbox/vbox_snapshot_conf.c b/src/vbox/vbox_snapshot_conf.c index 5792d3175e..4f12d2ebfa 100644 --- a/src/vbox/vbox_snapshot_conf.c +++ b/src/vbox/vbox_snapshot_conf.c @@ -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",