Skip to content

Commit 322309e

Browse files
[3.8] bpo-38168: Fix a possbile refleak in setint() of mmapmodule.c (GH-16136) (GH-16174)
(cherry picked from commit 56a4514) Co-authored-by: Hai Shi <shihai1992@gmail.com> https://bugs.python.org/issue38168 Automerge-Triggered-By: @zhangyangyu
1 parent 346b7c9 commit 322309e

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

Modules/mmapmodule.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1468,7 +1468,8 @@ static void
14681468
setint(PyObject *d, const char *name, long value)
14691469
{
14701470
PyObject *o = PyLong_FromLong(value);
1471-
if (o && PyDict_SetItemString(d, name, o) == 0) {
1471+
if (o) {
1472+
PyDict_SetItemString(d, name, o);
14721473
Py_DECREF(o);
14731474
}
14741475
}

0 commit comments

Comments
 (0)