[xml] xmlParseFile - calling with nonexisting filename and memory leak




Hi,
My server (c++/multithreaded/linux) is using libxml2 version 2.6.11.
In the startup the main thread call xmlInitParser, and in case of initiated
shutdown call to xmlCleanupParser.

A thread may call âxmlParseFileâ with nonexisting filename.
Purify point to memory-leak each time âxmlParseFileâ attempt to load
nonexisting file:
         MLK: 75 bytes leaked at 0x10f02ca0
         This memory was allocated from:
               malloc         [rtlib.o]
               xmlStrndup     [libxml2.so.2]
               xmlStrdup      [libxml2.so.2]
               xmlCopyError   [libxml2.so.2]
               __xmlRaiseError [libxml2.so.2]
               __xmlLoaderErr [libxml2.so.2]
         MLK: 41 bytes leaked at 0x18f71420
         This memory was allocated from:
               malloc         [rtlib.o]
               xmlStrndup     [libxml2.so.2]
               xmlStrdup      [libxml2.so.2]
               xmlCopyError   [libxml2.so.2]
               __xmlRaiseError [libxml2.so.2]
               __xmlLoaderErr [libxml2.so.2]

What is the right approach to catch and clean this memory?
Should I use xmlGenericErrorFunc (void * ctx,  const char * msg) â but what
to delete?

Thanks In Advanced,
Tamar
-- 
View this message in context: 
http://www.nabble.com/xmlParseFile---calling-with-nonexisting-filename-and-memory-leak-tp14566740p14566740.html
Sent from the Gnome - Lib - Xml - General mailing list archive at Nabble.com.




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