Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 56a4514

Browse files
shihai1991zhangyangyu
authored andcommitted
Fix a possbile refleak in setint() of mmapmodule.c (GH-16136)
1 parent 24d1597 commit 56a4514

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)