RE: [libxml++] Memory leak?



It sounds sensible.

1. Does the leak happen with the examples?
2. Have you tried your fix.
3. If it works then could you submit a patch?

Thanks.

Murray Cumming
murrayc usa net
www.murrayc.com 

> -----Original Message-----
> From: Morten Hanssen [mailto:morten hanssen pd politiet no] 
> Sent: Dienstag, 3. Juni 2003 10:18
> To: libxmlplusplus-general lists sourceforge net
> Subject: [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.
> 
> 




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