[xml] Memory leaks

2014-08-25 Thread Iñigo Martínez
Hi, I have been looking at the memory usage of my programs using libxml2 y using valgrind, and I have seen these messages: ==22134== Invalid read of size 8 ==22134==at 0x519482F: xmlFreeNode (in /usr/lib/x86_64-linux-gnu/libxml2.so.2.9.1) ==22134==by 0x400A02: main (test-command.c:51) ==2

Re: [xml] Memory leaks

2014-08-25 Thread Nick Wellnhofer
On 25/08/2014 11:33, Iñigo Martínez wrote: Hi, I have been looking at the memory usage of my programs using libxml2 y using valgrind, and I have seen these messages: ==22134== Invalid read of size 8 ==22134==at 0x519482F: xmlFreeNode (in /usr/lib/x86_64-linux-gnu/libxml2.so.2.9.1) ==22134==

Re: [xml] Memory leaks

2014-08-25 Thread Iñigo Martínez
My bad, true it was a use-after-free error. I was expecting xmlUnlinkNode to totally unlink it, included removing the reference to the document. I have fixed it with: xmlSetTreeDoc (msg, NULL); Thank you very much :) 2014-08-25 12:31 GMT+02:00 Nick Wellnhofer : > On 25/08/2014 11:33, Iñigo