mirror of
https://github.com/tesseract-ocr/tesseract.git
synced 2025-01-19 15:03:45 +08:00
Fixed the memory leak/double free cleanly
This commit is contained in:
parent
fe9fa88f1d
commit
8a7de59f5d
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user