]> git.ipfire.org Git - thirdparty/libvirt.git/commit
bhyveConnectDomainXMLToNative: Fix memory leak in incorrect virCommandToString usage
authorPeter Krempa <pkrempa@redhat.com>
Fri, 11 Jun 2021 08:08:37 +0000 (10:08 +0200)
committerPeter Krempa <pkrempa@redhat.com>
Tue, 15 Jun 2021 14:58:07 +0000 (16:58 +0200)
commite8a396682be807d8c31ef58cd9d2a3020e0b37be
tree8da3ed61a13e03fe508a5cc7b0ce0a038d19cf36
parent9a82146fcde5481c11ed788ce4e09a3905a1c4d6
bhyveConnectDomainXMLToNative: Fix memory leak in incorrect virCommandToString usage

virCommandToString returns an allocated buffer, so using it directly as
argument of virBufferAdd which doesn't consume the string causes it to
be leaked. Switch to virBufferToStringBuf since we are already using a
buffer.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
src/bhyve/bhyve_driver.c