mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-03-07 17:28:15 +00:00
util: buffer: Use 'cleanup' as label name in virBufferAddBuffer
Signed-off-by: Peter Krempa <pkrempa@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
parent
a5217cd7c0
commit
ff06e83407
@ -201,22 +201,22 @@ virBufferAddBuffer(virBufferPtr buf, virBufferPtr toadd)
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
if (!buf)
|
if (!buf)
|
||||||
goto done;
|
goto cleanup;
|
||||||
|
|
||||||
if (buf->error || toadd->error) {
|
if (buf->error || toadd->error) {
|
||||||
if (!buf->error)
|
if (!buf->error)
|
||||||
virBufferSetError(buf, toadd->error);
|
virBufferSetError(buf, toadd->error);
|
||||||
goto done;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (virBufferGrow(buf, toadd->use) < 0)
|
if (virBufferGrow(buf, toadd->use) < 0)
|
||||||
goto done;
|
goto cleanup;
|
||||||
|
|
||||||
memcpy(&buf->content[buf->use], toadd->content, toadd->use);
|
memcpy(&buf->content[buf->use], toadd->content, toadd->use);
|
||||||
buf->use += toadd->use;
|
buf->use += toadd->use;
|
||||||
buf->content[buf->use] = '\0';
|
buf->content[buf->use] = '\0';
|
||||||
|
|
||||||
done:
|
cleanup:
|
||||||
virBufferFreeAndReset(toadd);
|
virBufferFreeAndReset(toadd);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user