[libxml++] Memory leak?



Hi,

I have used libxml++ a little bit lately, and I *think* I have found a memory leak in the write_to_string() function in the class Document. Internally this functions call the libxml functions xmlDocDumpMemory() and xmlDocDumpMemory(). Both of these functions internally call yet another libxml function, which says in it's code documentation that the caller of the function is responsible for freeing the allocated buffer using xmlFree().

But, as we can see in Document's write_to_string(), the code does not free the buffer after calling the libxml functions, it only creates a copy of the buffer in a std::string and returns that copy. Thus the original allocated memory is not destroyed.

Anyone agree with me on this one? :)

Thanks in advance,
Morten.

******************************* (on mailgw)

email-body was scanned. No virus was found.
*******************************


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]