Skip to content

Commit 9930b88

Browse files
shihai1991miss-islington
authored andcommitted
Fix a possbile refleak in setint() of mmapmodule.c (pythonGH-16136)
(cherry picked from commit 56a4514) Co-authored-by: Hai Shi <shihai1992@gmail.com>
1 parent 26c44b5 commit 9930b88

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
@@ -1392,7 +1392,8 @@ static void
13921392
setint(PyObject *d, const char *name, long value)
13931393
{
13941394
PyObject *o = PyLong_FromLong(value);
1395-
if (o && PyDict_SetItemString(d, name, o) == 0) {
1395+
if (o) {
1396+
PyDict_SetItemString(d, name, o);
13961397
Py_DECREF(o);
13971398
}
13981399
}

0 commit comments

Comments
 (0)