Re: [libvirt] [PATCH] qemu: Avoid memleak on failure to format blockjobs

2018-10-19 Thread Michal Privoznik
On 10/18/2018 10:42 PM, Eric Blake wrote: > On 10/18/18 3:08 PM, Eric Blake wrote: >> 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() >>

Re: [libvirt] [PATCH] qemu: Avoid memleak on failure to format blockjobs

2018-10-18 Thread Eric Blake
On 10/18/18 3:08 PM, Eric Blake wrote: 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

[libvirt] [PATCH] qemu: Avoid memleak on failure to format blockjobs

2018-10-18 Thread Eric Blake
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 Blak