-
-
Notifications
You must be signed in to change notification settings - Fork 32.7k
bpo-32013: _pickle: Add missing Py_DECREF in error case in fast_save_enter() #4384
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
Conversation
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); |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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. |
Thanks @lioncash for the PR, and @serhiy-storchaka for merging it 🌮🎉.. I'm working now to backport this PR to: 3.6. |
GH-4385 is a backport of this pull request to the 3.6 branch. |
…enter() (pythonGH-4384) (cherry picked from commit f76231f)
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