Re: [xml] xmlAllocOutputBuffer allocates memory I can't free
- From: Joachim Bauch <bauch struktur de>
- To: Dominic Eales <eales fastcom-technology com>
- Cc: XML List <xml gnome org>
- Subject: Re: [xml] xmlAllocOutputBuffer allocates memory I can't free
- Date: Thu, 08 Apr 2004 19:35:55 +0200
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]