[Libguestfs] [libhivex] Memory leak in hivex_node_delete_child?

Pino Toscano ptoscano at redhat.com
Tue Nov 11 10:41:33 UTC 2014


Hi,

On Monday 10 November 2014 18:28:52 Mahmoud Al-Qudsi wrote:
> I’m not able to pin it myself from a brief look, but it seems that
> under certain conditions a call to hivex_node_delete_child can cause
> the allocations from _hivex_get_children to not be freed properly?
> 
> I know that if the return value of _hivex_get_children is -1, no free
> is called; but from what I can see, -1 means there is nothing to be
> freed/it’s been taken care of.
> 
> I’ve attached the valgrind log together with the output of
> HIVEX_OPEN_DEBUG, please let me know if there’s anything else I can
> provide to make this easier.

It seems like rather hivex_node_delete_child leaks the "blocks" array 
returned by _hivex_get_children every time. The patch should be easy, 
would you be able to give it a try to check whether it fixes the leak in 
your application?

Thanks,
-- 
Pino Toscano
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-lib-write-fix-memory-leak.patch
Type: text/x-patch
Size: 826 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/libguestfs/attachments/20141111/cf5da8b6/attachment.bin>


More information about the Libguestfs mailing list