Skip to content

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

Merged
merged 1 commit into from
Nov 13, 2017

Conversation

lioncash
Copy link
Contributor

@lioncash lioncash commented Nov 13, 2017

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

@the-knights-who-say-ni
Copy link

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);
Copy link
Member

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done!

@serhiy-storchaka serhiy-storchaka added needs backport to 3.6 skip news type-bug An unexpected behavior, bug, or error labels Nov 13, 2017
@serhiy-storchaka
Copy link
Member

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.

@serhiy-storchaka serhiy-storchaka merged commit f76231f into python:master Nov 13, 2017
@miss-islington
Copy link
Contributor

Thanks @lioncash for the PR, and @serhiy-storchaka for merging it 🌮🎉.. I'm working now to backport this PR to: 3.6.
🐍🍒⛏🤖

@bedevere-bot
Copy link

GH-4385 is a backport of this pull request to the 3.6 branch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
skip news type-bug An unexpected behavior, bug, or error
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants