提交 5c4fc07d 编写于 作者: J Jiri Denemark

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: NJiri Denemark <jdenemar@redhat.com>
上级 8a573f7c
......@@ -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);
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册