Skip to content

Commit 68d8c12

Browse files
authored
[2.7] bpo-38168: Fix a possbile refleak in setint() of mmapmodule.c (GH-16136) (GH-16176)
(cherry picked from commit 56a4514) Co-authored-by: Hai Shi [email protected] https://bugs.python.org/issue38168
1 parent 8dd358c commit 68d8c12

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Modules/mmapmodule.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1436,7 +1436,8 @@ static void
14361436
setint(PyObject *d, const char *name, long value)
14371437
{
14381438
PyObject *o = PyInt_FromLong(value);
1439-
if (o && PyDict_SetItemString(d, name, o) == 0) {
1439+
if (o) {
1440+
PyDict_SetItemString(d, name, o);
14401441
Py_DECREF(o);
14411442
}
14421443
}

0 commit comments

Comments
 (0)