bpo-32013: _pickle: Add missing Py_DECREF in error case in fast_save_enter() by lioncash · Pull Request #4384 · python/cpython (original) (raw)
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 andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Conversation6 Commits1 Checks0 Files changed
Conversation
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
[ Show hidden characters]({{ revealButtonHref }})
Hi! As said on the issue filed. I'm new to the development/contribution process for Python, so I figured I'd start with something small, just get used to things.
As far as I understand, there should be a Py_DECREF in this conditional.
https://bugs.python.org/issue32013
Hello, and thanks for your contribution!
I'm a bot set up to make sure that the project can legally accept your contribution by verifying you have signed the PSF contributor agreement (CLA).
Unfortunately our records indicate you have not signed the CLA. For legal reasons we need you to sign this before we can look at your contribution. Please follow the steps outlined in the CPython devguide to rectify this issue.
Thanks again to your contribution and we look forward to looking at it!
@@ -1789,6 +1789,7 @@ fast_save_enter(PicklerObject *self, PyObject *obj) |
---|
return 0; |
} |
if (PyErr_Occurred()) { |
Py_DECREF(key); |
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it is worth to add self->fast_nesting = -1;
here and before other return 0
above.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done!
Thank you for your contribution @lioncash! It is not required for this simple change, but would be nice if you sign the PSF contributor agreement (CLA). Just for the case of your future more complex pull requests.
miss-islington pushed a commit to miss-islington/cpython that referenced this pull request