From: Hai Shi Date: Mon, 16 Sep 2019 05:56:57 +0000 (-0500) Subject: Fix a possbile refleak in setint() of mmapmodule.c (GH-16136) X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=56a45142e70a1ccf3233d43cb60c47255252e89a;p=python Fix a possbile refleak in setint() of mmapmodule.c (GH-16136) --- diff --git a/Modules/mmapmodule.c b/Modules/mmapmodule.c index 51ab3f054f..0c641636a1 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); } }