Skip to content

Commit

Permalink
Classify: Fix new resource leak (CID 1396163)
Browse files Browse the repository at this point in the history
This fixes a warnings from Coverity Scan.

Signed-off-by: Stefan Weil <[email protected]>
  • Loading branch information
stweil committed Oct 16, 2018
1 parent edbd07a commit 146d2ca
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/classify/adaptmatch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1543,7 +1543,10 @@ void Classify::DoAdaptiveMatch(TBLOB *Blob, ADAPT_RESULTS *Results) {

// TODO: With LSTM, static_classifier_ is nullptr.
// Return to avoid crash in CharNormClassifier.
if (static_classifier_ == nullptr) return;
if (static_classifier_ == nullptr) {
delete sample;
return;
}

if (AdaptedTemplates->NumPermClasses < matcher_permanent_classes_min ||
tess_cn_matching) {
Expand Down

0 comments on commit 146d2ca

Please sign in to comment.