Fix a possbile refleak in setint() of mmapmodule.c (GH-16136)
This commit is contained in:
parent
24d1597e43
commit
56a45142e7
|
@ -1468,7 +1468,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);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue