virDomainDefFormatInternal (called by qemuDomainDefFormatXMLInternal)
already checks for buffer errors and properly resets the buffer on
failure.
Signed-off-by: Jiri Denemark <jdenemar(a)redhat.com>
---
src/qemu/qemu_domain.c | 10 +---------
1 file changed, 1 insertion(+), 9 deletions(-)
diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
index e09d848db6..689dbdb043 100644
--- a/src/qemu/qemu_domain.c
+++ b/src/qemu/qemu_domain.c
@@ -4719,16 +4719,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);
}
--
2.14.1