Skip to content

Commit

Permalink
classify/adaptmatch: Fix memory leak
Browse files Browse the repository at this point in the history
Coverity report:

CID 1164738 (tesseract-ocr#1 of 1): Resource leak (RESOURCE_LEAK)
7. leaked_storage: Variable sample going out of scope leaks the storage it points to.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
  • Loading branch information
stweil committed Oct 24, 2016
1 parent bf334e0 commit 963b935
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions classify/adaptmatch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1001,6 +1001,8 @@ void Classify::DisplayAdaptedChar(TBLOB* blob, INT_CLASS_STRUCT* int_class) {
6 | 0x19, matcher_debug_separate_windows);
UpdateMatchDisplay();
}

delete sample;
#endif
}

Expand Down

0 comments on commit 963b935

Please sign in to comment.