Skip to content

Commit

Permalink
Fixed the memory leak/double free cleanly
Browse files Browse the repository at this point in the history
  • Loading branch information
theraysmith committed Nov 28, 2016
1 parent 3d00d3b commit 185a264
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion classify/adaptmatch.cpp
Expand Up @@ -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;
}
Expand Down

0 comments on commit 185a264

Please sign in to comment.