bpo-31455: fix reference leak#6318
Merged
serhiy-storchaka merged 4 commits intopython:2.7from Mar 31, 2018
Merged
Conversation
…executing user code) with a live exception set. Backport to Py2.7
…rror handling fixes. This change generally splits the xmlparser creation code into an unsafe part with "rollback" error handling and a safe "object initialisation done" part with normal decref cleanup.
Contributor
Author
|
The travis build failure seems unrelated. The relevant tests had already passed by then. |
| ALLOC(sizeof(XMLParserObject), "create expatparser"); | ||
|
|
||
| /* Init to NULL to keep the error handling below manageable. */ | ||
| self->target = |
Member
There was a problem hiding this comment.
This is not needed. PyObject_New() clears the memory.
Contributor
Author
There was a problem hiding this comment.
I thought so, too, until the test started crashing due to uninitalised struct fields.
Member
There was a problem hiding this comment.
Oh, seems I remember this wrong.
serhiy-storchaka
approved these changes
Mar 31, 2018
| ALLOC(sizeof(XMLParserObject), "create expatparser"); | ||
|
|
||
| /* Init to NULL to keep the error handling below manageable. */ | ||
| self->target = |
Member
There was a problem hiding this comment.
Oh, seems I remember this wrong.
Member
|
Seems the test is failed for unrelated cause. |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes a reference leak to 'self' in the previous implementation.
https://bugs.python.org/issue31455