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



(cherry picked from commit 56a45142e70a1ccf3233d43cb60c47255252e89a)


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

https://bugs.python.org/issue38168



Automerge-Triggered-By: @zhangyangyu
diff --git a/Modules/mmapmodule.c b/Modules/mmapmodule.c
index 9e3414f..1875886 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);
     }
 }