[xml] Memory leak with xmlSaveFormatFileEnc( )




Friends,
I ve written a module to dump some real time data into an XML file at regular intervals.
I am using  xmlSaveFormatFileEnc( ) finaly to save the file.

But i am getting memory leak report with the Valgrind with the API xmlSaveFormatFileEnc( ).

The leak summary is as below,

==8355== 261,507,768 bytes in 506,798 blocks are definitely lost in loss record 109 of 109
==8355==    at 0x402BE68: malloc (in /usr/lib/valgrind/vgpreload_memcheck-x86-linux.so)
==8355==    by 0x40E43FB: xmlGetGlobalState (in /usr/lib/i386-linux-gnu/libxml2.so.2.7.8)
==8355==    by 0x40E3A22: __xmlIndentTreeOutput (in /usr/lib/i386-linux-gnu/libxml2.so.2.7.8)
==8355==    by 0x414BE54: ??? (in /usr/lib/i386-linux-gnu/libxml2.so.2.7.8)
==8355==    by 0x414C598: ??? (in /usr/lib/i386-linux-gnu/libxml2.so.2.7.8)
==8355==    by 0x414BE42: ??? (in /usr/lib/i386-linux-gnu/libxml2.so.2.7.8)
==8355==    by 0x414C598: ??? (in /usr/lib/i386-linux-gnu/libxml2.so.2.7.8)
==8355==    by 0x414BE42: ??? (in /usr/lib/i386-linux-gnu/libxml2.so.2.7.8)
==8355==    by 0x414C598: ??? (in /usr/lib/i386-linux-gnu/libxml2.so.2.7.8)
==8355==    by 0x414BE42: ??? (in /usr/lib/i386-linux-gnu/libxml2.so.2.7.8)
==8355==    by 0x414C598: ??? (in /usr/lib/i386-linux-gnu/libxml2.so.2.7.8)
==8355==    by 0x414BE42: ??? (in /usr/lib/i386-linux-gnu/libxml2.so.2.7.8)
==8355==    by 0x414C598: ??? (in /usr/lib/i386-linux-gnu/libxml2.so.2.7.8)
==8355==    by 0x414BE42: ??? (in /usr/lib/i386-linux-gnu/libxml2.so.2.7.8)
==8355==    by 0x414B8B7: ??? (in /usr/lib/i386-linux-gnu/libxml2.so.2.7.8)
==8355==    by 0x414D339: xmlSaveFormatFileEnc (in /usr/lib/i386-linux-gnu/libxml2.so.2.7.8)
==8355==    by 0x805D5F0: store_to_xmlfile(char*, char*) (ram_utilities.cpp:248)
==8355==    by 0x805D3E1: FetchDataFromFifo() (ram_utilities.cpp:198)
==8355==    by 0x8050A5D: ThreadFn_RqstAnlysr(void*) (request_analyser_module.cpp:134)
==8355==    by 0x42FDD4B: start_thread (pthread_create.c:308)
==8355==

Please suggest me the measures to avoid memory leaks.
--
Regards...,
Shanthkumara O.D.


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