Re: [xml] xmlAllocOutputBuffer allocates memory I can't free



Hi,

Dominic Eales wrote:
I am using libxml 2.26 and I call the function xmlDocDumpFormatMemoryEnc which
allocates some memory with the function xmlAllocOutputBuffer().

The problem is when I try to free this memory with the standard C function free() the debugger
says that the memory was never allocated…

Why is that?

you should use the correct libxml2 API to free the allocated data, which
is "xmlFree" in this case:

http://xmlsoft.org/html/libxml-tree.html#xmlDocDumpFormatMemoryEnc

<quote>
Note it is up to the caller of this function to free the allocated memory
with xmlFree().
</quote>

Joachim



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