Fixed the memory leak/double free cleanly

This commit is contained in:
Ray Smith 2016-11-28 09:39:17 -08:00 committed by Zdenko Podobný
parent fe9fa88f1d
commit 8a7de59f5d

View File

@ -819,7 +819,7 @@ int Classify::GetAdaptiveFeatures(TBLOB *Blob,
Features = ExtractPicoFeatures(Blob);
NumFeatures = Features->NumFeatures;
if (NumFeatures > UNLIKELY_NUM_FEAT) {
if (NumFeatures == 0 || NumFeatures > UNLIKELY_NUM_FEAT) {
FreeFeatureSet(Features);
return 0;
}