Commit 68d8c122 authored by Xiang Zhang's avatar Xiang Zhang Committed by GitHub

[2.7] bpo-38168: Fix a possbile refleak in setint() of mmapmodule.c (GH-16136) (GH-16176)

(cherry picked from commit 56a45142)

Co-authored-by: Hai Shi shihai1992@gmail.com

https://bugs.python.org/issue38168
parent 8dd358ca
......@@ -1436,7 +1436,8 @@ static void
setint(PyObject *d, const char *name, long value)
{
PyObject *o = PyInt_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