[xml] A leak in XmlTextReader?
- From: Micha Renner <Micha Renner t-online de>
- To: xml gnome org
- Subject: [xml] A leak in XmlTextReader?
- Date: Fri, 28 Mar 2008 17:26:03 +0100
Hello,
The use of xmlNewTextReaderFilename might create a memory leak, because
no one expects that xmlGetCharEncodingHandler() is called
(enc==XML_CHAR_ENCODING_NONE!). So nobody calls
xmlCleanupCharEncoding().
There are two possibilities to solve this problem:
Best version: I would divide the switch-Statement in
xmlGetCharEncodingHandler() (encoding.c) in two parts. The first part
has all the NULL-returns, the second has the rest.
Between both is the xmlInitCharEncodingHandlers()-call.
Second version: The last statement in xmlFreeTextReader should be
xmlCleanupCharEncoding().
Greetings
Michael
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]