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

Prevent containerH being used after it was freed #558

Merged
merged 1 commit into from Jul 6, 2016

Conversation

janisozaur
Copy link
Contributor

No description provided.

@skitaoka skitaoka added the bug label Jul 1, 2016
@skitaoka
Copy link
Member

skitaoka commented Jul 1, 2016

Jenkins, test this.

@@ -273,6 +273,7 @@ int TTWAIN_SetCap(TW_UINT16 cap_id, TW_UINT16 conType, TW_UINT16 itemType,
if (!capabilityH) {
GLOBAL_UNLOCK(containerH);
GLOBAL_FREE(containerH);
containerH = NULL;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if capabilityH was not allocated properly, this block will clean up containerH allocated in line 266 above, which may get used and freed again in here: https://github.com/opentoonz/opentoonz/pull/558/files/1d0596c8d8043e5905fe897ba2d46df5d3040a8c#diff-e10fd83cafdc05ffcb241ff7619a730dR296

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm sorry. I read the variable name wrong.

@skitaoka
Copy link
Member

skitaoka commented Jul 4, 2016

Jenkins, test this, again.

@skitaoka
Copy link
Member

skitaoka commented Jul 6, 2016

LGTM

@skitaoka skitaoka merged commit af8faa4 into opentoonz:master Jul 6, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants