8000 [3.7] bpo-38168: Fix a possbile refleak in setint() of mmapmodule.c (GH-16136) by miss-islington · Pull Request #16175 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

[3.7] bpo-38168: Fix a possbile refleak in setint() of mmapmodule.c (GH-16136) #16175

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
Sep 16, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Fix a possbile refleak in setint() of mmapmodule.c (GH-16136)
(cherry picked from commit 56a4514)

Co-authored-by: Hai Shi <shihai1992@gmail.com>
  • Loading branch information
shihai1991 authored and miss-islington committed Sep 16, 2019
commit 9930b88b7b1b33eddef875065412453b84f3b37f
3 changes: 2 additions & 1 deletion Modules/mmapmodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -1392,7 +1392,8 @@ static void
setint(PyObject *d, const char *name, long value)
{
PyObject *o = PyLong_FromLong(value);
if (o && PyDict_SetItemString(d, name, o) == 0) {
if (o) {
PyDict_SetItemString(d, name, o);
Py_DECREF(o);
}
}
Expand Down
0