]> git.ipfire.org Git - thirdparty/libvirt.git/commit
qemu: Avoid memleak on failure to format blockjobs
authorEric Blake <eblake@redhat.com>
Thu, 18 Oct 2018 20:05:22 +0000 (15:05 -0500)
committerEric Blake <eblake@redhat.com>
Fri, 19 Oct 2018 15:33:19 +0000 (10:33 -0500)
commitffac10c971d4db55744a63a80b4b9db7f8872e00
tree2d7770d2aeadb325c466fcfc45f2f7dbc1982b9d
parentc0790e3a09f57da0bd25c7eac4a35ed6e7e9e858
qemu: Avoid memleak on failure to format blockjobs

virXMLFormatElement() frees attrBuf on success, but not necessarily
on failure. Most other callers of this function take the time to
reset attrBuf afterwords, but qemuDomainObjPrivateXMLFormatBlockjobs()
was relying on it succeeding, and could thus result in a memory leak.

Signed-off-by: Eric Blake <eblake@redhat.com>
ACKed-by: Michal Privoznik <mprivozn@redhat.com>
src/qemu/qemu_domain.c