]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
qemu: Fix error checking in qemuDomainDefFormatXMLInternal
authorJiri Denemark <jdenemar@redhat.com>
Fri, 15 Sep 2017 14:41:18 +0000 (16:41 +0200)
committerJiri Denemark <jdenemar@redhat.com>
Fri, 22 Sep 2017 12:02:59 +0000 (14:02 +0200)
virDomainDefFormatInternal (called by qemuDomainDefFormatXMLInternal)
already checks for buffer errors and properly resets the buffer on
failure.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
src/qemu/qemu_domain.c

index 94c95140f2e21604cb2873c4e0fe5c890e279d76..ddc76b1c932c40c4950daf4fa9cea9ba6d985709 100644 (file)
@@ -4728,16 +4728,8 @@ qemuDomainDefFormatXMLInternal(virQEMUDriverPtr driver,
 {
     virBuffer buf = VIR_BUFFER_INITIALIZER;
 
-    if (qemuDomainDefFormatBufInternal(driver, def, origCPU, flags, &buf) < 0) {
-        virBufferFreeAndReset(&buf);
+    if (qemuDomainDefFormatBufInternal(driver, def, origCPU, flags, &buf) < 0)
         return NULL;
-    }
-
-    if (virBufferError(&buf)) {
-        virReportOOMError();
-        virBufferFreeAndReset(&buf);
-        return NULL;
-    }
 
     return virBufferContentAndReset(&buf);
 }