This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: _pickle: Py_DECREF seems to be missing from a failure case in fast_save_enter()
Type: resource usage Stage: resolved
Components: Extension Modules Versions: Python 3.7, Python 3.6
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: Mathew M., serhiy.storchaka
Priority: normal Keywords: patch

Created on 2017-11-13 05:08 by Mathew M., last changed 2022-04-11 14:58 by admin. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 4384 merged Mathew M., 2017-11-13 05:12
PR 4385 merged python-dev, 2017-11-13 07:50
Messages (3)
msg306139 - (view) Author: Mathew M. (Mathew M.) * Date: 2017-11-13 05:08
Hey there! I'm fairly new to the development process for Python, so I figured I'd start off with something tiny and then work on up from there. I'm not sure if this sort of minor fix warrants an issue being created, but I made this just to err on the safe side of things.

So, as far as I understand (by all means correct me if I'm wrong), a 'Py_DECREF(key);' should be present before the return in the conditional within fast_save_enter() (https://github.com/python/cpython/blob/d7d4fea4a39da4bfdea1de22fe040023eb4ddc17/Modules/_pickle.c#L1792)
msg306147 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2017-11-13 07:50
New changeset f76231f89a7231fd486b37f728fbb4aab389e4d7 by Serhiy Storchaka (Mat M) in branch 'master':
bpo-32013: _pickle: Add missing Py_DECREF in error case in fast_save_enter() (#4384)
https://github.com/python/cpython/commit/f76231f89a7231fd486b37f728fbb4aab389e4d7
msg306148 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2017-11-13 08:19
New changeset 6ed9d4ecde8c3f0eeadf188f15a5bbd32b9d1145 by Serhiy Storchaka (Miss Islington (bot)) in branch '3.6':
bpo-32013: _pickle: Add missing Py_DECREF in error case in fast_save_enter() (GH-4384) (#4385)
https://github.com/python/cpython/commit/6ed9d4ecde8c3f0eeadf188f15a5bbd32b9d1145
History
Date User Action Args
2022-04-11 14:58:54adminsetgithub: 76194
2017-11-13 08:21:13serhiy.storchakasetstatus: open -> closed
type: resource usage
stage: patch review -> resolved
resolution: fixed
versions: + Python 3.6
2017-11-13 08:19:54serhiy.storchakasetmessages: + msg306148
2017-11-13 07:50:31python-devsetpull_requests: + pull_request4333
2017-11-13 07:50:18serhiy.storchakasetnosy: + serhiy.storchaka
messages: + msg306147
2017-11-13 05:12:58Mathew M.setkeywords: + patch
stage: patch review
pull_requests: + pull_request4331
2017-11-13 05:08:34Mathew M.create