WG: [xml] memory leak in xmlTextWriter? - Email found in subject



Sorry, forgot to send to the list.

-----Ursprüngliche Nachricht-----
Von: Mickautsch, Alfred 
Gesendet: Dienstag, 20. Januar 2004 15:14
An: 'Manuel González Castro'
Betreff: AW: [xml] memory leak in xmlTextWriter? - Email found in
subject


[...]

Hi,

Last week I reported a possible bug in xmlTextWriter (bug #131368), 

Sorry, I didn't get yor mail. But it seems that we have some problems
with our new spam filter here...

[...]
I ran the testcase code inside a loop and the memory 
increases about 12K per iteration, so it seems it's a memory leak.

Yes, the allocated xmlParserCtxtPtr was never freed .


Am I misusing xmlTextWriter?


No.

If the answer is no, I think that the memory leaked is 
allocated in function xmlAllocParserInputBuffer (xmlIO.c) 
line 1960, this is the call stack (line numbers refer to 
cvs-snapshot 2004-01-20):

xmlAllocParserInputBuffer(int 0) [xmlIO.c, line 1960]

xmlCreatePushParserCtxt(_xmlSAXHandler * 0x0012fe9c, void * 
0x00000000, const char * 0x00000000, int 0, const char * 
0x00000000) [parser.c, line 9750]

xmlNewTextWriterDoc(_xmlDoc * * 0x0012ff78, int 0) 
[xmlwriter.c, line 277]

main() [line 11]

Thanks, helped me a lot.

Of course the leak is not in xmlIO.c or parser.c, but my 
understanding of xmlTextWriter isn't enough to be able to 
provide a patch for xmlwriter.c.

Could anybody give me a hint, please?


The attached patch should fix this.

Thanks again for the input.

Servus -- Alfred

Attachment: xmlwriter_20040120-2.patch
Description: xmlwriter_20040120-2.patch



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