-
Notifications
You must be signed in to change notification settings - Fork 9.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
classify/adaptmatch: Fix memory leak
Coverity report: CID 1340280 (#1 of 1): Resource leak (RESOURCE_LEAK) 7. leaked_storage: Variable FloatFeatures going out of scope leaks the storage it points to. Signed-off-by: Stefan Weil <[email protected]>
- Loading branch information
Showing
1 changed file
with
3 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -907,8 +907,10 @@ void Classify::AdaptToChar(TBLOB* Blob, CLASS_ID ClassId, int FontinfoId, | |
IClass = ClassForClassId(adaptive_templates->Templates, ClassId); | ||
|
||
NumFeatures = GetAdaptiveFeatures(Blob, IntFeatures, &FloatFeatures); | ||
if (NumFeatures <= 0) | ||
if (NumFeatures <= 0) { | ||
FreeFeatureSet(FloatFeatures); | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
stweil
Author
Member
|
||
return; | ||
} | ||
|
||
// Only match configs with the matching font. | ||
BIT_VECTOR MatchingFontConfigs = NewBitVector(MAX_NUM_PROTOS); | ||
|
@stweil I'm getting a crash here (when running on Android) with the message
Invalid address passed to free: invalid page index
. I'm planning to open an issue with steps to reproduce the problem.Stack trace here: rmtheis/tess-two#180