Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix two new coverity warnings #524

Merged
merged 2 commits into from
Dec 3, 2016
Merged

Conversation

stweil
Copy link
Member

@stweil stweil commented Dec 2, 2016

The latest Coverity Scan reports 10 fixed defects and 2 new defects. Fix the new defects.

Coverity report:

CID 1366758:  Memory - corruptions  (USE_AFTER_FREE)
Calling "operator delete[]" frees pointer "label32"
 which has already been freed.

Commit f60ff4d fixed several memory leaks
but also added this wrong delete operation.

label32 is assigned to char_samp->label32_, so it is freed when deleting
char_samp.

Signed-off-by: Stefan Weil <[email protected]>
Commit 03eec61 removed unneeded
null pointer checks after new, but missed one which now raises
a warning from coverity scan. Remove that one, too.

Signed-off-by: Stefan Weil <[email protected]>
@egorpugin egorpugin merged commit 3e11fc1 into tesseract-ocr:master Dec 3, 2016
@stweil stweil deleted the coverity branch December 3, 2016 09:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants