Classify: Fix new resource leak (CID 1396163)

This fixes a warnings from Coverity Scan.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
This commit is contained in:
Stefan Weil 2018-10-16 13:16:54 +02:00
parent edbd07a5f9
commit 146d2caa9d

View File

@ -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) {