1
0
mirror of https://gitlab.com/libvirt/libvirt.git synced 2025-03-23 18:50:21 +03:00

qemu: Fix error checking in qemuDomainDefFormatXMLInternal

virDomainDefFormatInternal (called by qemuDomainDefFormatXMLInternal)
already checks for buffer errors and properly resets the buffer on
failure.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
This commit is contained in:
Jiri Denemark 2017-09-15 16:41:18 +02:00
parent 8a573f7c0c
commit 5c4fc07d1a

View 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);
}