commit | 56a45142e70a1ccf3233d43cb60c47255252e89a | [log] [tgz] |
---|---|---|
author | Hai Shi <shihai1992@gmail.com> | Mon Sep 16 00:56:57 2019 -0500 |
committer | Xiang Zhang <angwerzx@126.com> | Mon Sep 16 13:56:57 2019 +0800 |
tree | 6c16820011e893cc9a19976c01ce2657c254d238 | |
parent | 24d1597e430498ebe2d3d18fba2cacb3957b494d [diff] [blame] |
Fix a possbile refleak in setint() of mmapmodule.c (GH-16136)
diff --git a/Modules/mmapmodule.c b/Modules/mmapmodule.c index 51ab3f0..0c64163 100644 --- a/Modules/mmapmodule.c +++ b/Modules/mmapmodule.c
@@ -1468,7 +1468,8 @@ 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); } }