Memory leak from XmlOdb::XmlOdb(const char*xbuf,int bufLength)

Issue #11 resolved
Joseph McKenna created an issue

Memory leak from XmlOdb constructor, the memory assigned for char* buf array at line 29 in XmlOdb line 29:

charbuf = (char)malloc(bufLength);

does not get cleared

valgrind output:

8,249,028 bytes in 1 blocks are possibly lost in loss record 11,361 of 11,361 at 0x4C29BE3: malloc (vg_replace_malloc.c:299) by 0x448E44: XmlOdb::XmlOdb(char const, int) (XmlOdb.cxx:29) by 0x43D152: ProcessMidasFiles (manalyzer.cxx:645) by 0x43D152: manalyzer_main(int, char*) (manalyzer.cxx:1556) by 0xA9B6C04: (below main) (in /usr/lib64/libc-2.17.so)

Comments (2)

  1. Thomas Lindner

    Yes, that seems to be a bug; I committed a fix to the bug, but using free instead of delete (since memory is allocated with malloc). Reopen issue if it is not solved.

  2. Log in to comment