Skip to content

Commit

Permalink
[3.7] bpo-38168: Fix a possbile refleak in setint() of mmapmodule.c (G…
Browse files Browse the repository at this point in the history
…H-16136) (GH-16175)

(cherry picked from commit 56a4514)


Co-authored-by: Hai Shi <[email protected]>

Automerge-Triggered-By: @zhangyangyu
  • Loading branch information
miss-islington authored Sep 16, 2019
1 parent 26c44b5 commit e857fe6
Showing 1 changed file with 2 additions and 1 deletion.
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 comments on commit e857fe6

Please sign in to comment.