Memory leak in pagetree.cpp

Bug #654776 reported by Dmitry Katsubo
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Cuneiform for Linux
New
Undecided
Unassigned

Bug Description

valgrind reports the following memory leak in cuneiform library.

Code fragment:
...
    SETUP_GENERATE_TREE setup;
    Inf.Tree.Root = (KNOTT*)malloc(sizeof(KNOTT));
    KNOTT *pRoot=Inf.Tree.Root,*ptr,*ptr1,*ptr2;
...

After my brief review I have found out that Inf.Tree.Root may not be fee()'ed if:
* "alDebug" is defined, and OpenFullOutTiger(InFileName) returns false.
* FlagBadBad is set to true in line 1901.

==29705== 18,386 bytes in 317 blocks are definitely lost in loss record 208 of 209
==29705== at 0x4823C4C: malloc (vg_replace_malloc.c:195)
==29705== by 0x51B226F: PageTree (pagetree.cpp:1845)
==29705== by 0x518D472: CRtfPage::FindPageTree(_IO_FILE*, char const*) (creatertf.cpp:675)
==29705== by 0x518BD1C: FullRtf (creatertf.cpp:150)
==29705== by 0x51A1C39: RFRMT_Formatter (frmt.cpp:224)
==29705== by 0x522A307: Recognize() (partrecog.cpp:825)
==29705== by 0x522B83B: PUMA_XFinalRecognition (puma.cpp:594)
==29705== by 0x18D91C: get_atom_label(Magick::Image const&, Magick::ColorGray const&, int, int, int, int, double, int, int) (osra_ocr.cpp:277)

Additional info:
Sources: http://ftp.de.debian.org/debian/pool/non-free/c/cuneiform/cuneiform_1.0.0+dfsg.orig.tar.bz2
osra_ocr.cpp: http://osra.svn.sourceforge.net/viewvc/osra/trunk/src/osra_ocr.cpp?revision=597&view=markup

Revision history for this message
Dmitry Katsubo (dma-k) wrote :

Can somebody verify / confirm this bug, no?

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.