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:
parent
8a573f7c0c
commit
5c4fc07d1a
@ -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);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user