mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-12 15:52:55 +00:00
cpu conf: Use virBufferFreeAndReset instead of virBufferContentAndReset and VIR_FREE
This commit is contained in:
parent
b1cd474c77
commit
376b311deb
@ -249,7 +249,6 @@ virCPUDefFormat(virConnectPtr conn,
|
|||||||
int flags)
|
int flags)
|
||||||
{
|
{
|
||||||
virBuffer buf = VIR_BUFFER_INITIALIZER;
|
virBuffer buf = VIR_BUFFER_INITIALIZER;
|
||||||
char *tmp;
|
|
||||||
|
|
||||||
if (virCPUDefFormatBuf(conn, &buf, def, indent, flags) < 0)
|
if (virCPUDefFormatBuf(conn, &buf, def, indent, flags) < 0)
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
@ -262,8 +261,7 @@ virCPUDefFormat(virConnectPtr conn,
|
|||||||
no_memory:
|
no_memory:
|
||||||
virReportOOMError(conn);
|
virReportOOMError(conn);
|
||||||
cleanup:
|
cleanup:
|
||||||
tmp = virBufferContentAndReset(&buf);
|
virBufferFreeAndReset(&buf);
|
||||||
VIR_FREE(tmp);
|
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user