Commit 56a45142 authored by Hai Shi's avatar Hai Shi Committed by Xiang Zhang

Fix a possbile refleak in setint() of mmapmodule.c (GH-16136)

parent 24d1597e
......@@ -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);
}
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment