From 56a45142e70a1ccf3233d43cb60c47255252e89a Mon Sep 17 00:00:00 2001 From: Hai Shi Date: Mon, 16 Sep 2019 00:56:57 -0500 Subject: Fix a possbile refleak in setint() of mmapmodule.c (GH-16136) --- Modules/mmapmodule.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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 @@ 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); } } -- cgit v0.12