Skip to content

Commit 185a264

Browse files
committed
Fixed the memory leak/double free cleanly
1 parent 3d00d3b commit 185a264

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

classify/adaptmatch.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -819,7 +819,7 @@ int Classify::GetAdaptiveFeatures(TBLOB *Blob,
819819
Features = ExtractPicoFeatures(Blob);
820820

821821
NumFeatures = Features->NumFeatures;
822-
if (NumFeatures > UNLIKELY_NUM_FEAT) {
822+
if (NumFeatures == 0 || NumFeatures > UNLIKELY_NUM_FEAT) {
823823
FreeFeatureSet(Features);
824824
return 0;
825825
}

0 commit comments

Comments
 (0)