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-Tag: v3.9.0a1~421 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=56a45142e70a1ccf3233d43cb60c47255252e89a;p=thirdparty%2FPython%2Fcpython.git Fix a possbile refleak in setint() of mmapmodule.c (GH-16136) --- diff --git a/Modules/mmapmodule.c b/Modules/mmapmodule.c index 51ab3f054f24..0c641636a1a8 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); } }