summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>2018-11-30 08:04:43 (GMT)
committerGitHub <noreply@github.com>2018-11-30 08:04:43 (GMT)
commitf3fe21a3cacbc5d13c3e61cefb36ce0efe617cd7 (patch)
tree1646a589a8db43b7b4e7231c2f41c66da33cdd74
parentf681e93e46925e862a8b0fa4b6e9e341fd8de3c2 (diff)
downloadcpython-f3fe21a3cacbc5d13c3e61cefb36ce0efe617cd7.zip
cpython-f3fe21a3cacbc5d13c3e61cefb36ce0efe617cd7.tar.gz
cpython-f3fe21a3cacbc5d13c3e61cefb36ce0efe617cd7.tar.bz2
bpo-35356: Fix a possible reference leak in nis.maps(). (GH-10808)
(cherry picked from commit a2e3585e79c93b2372dbad46a744e28fcc6dad6d) Co-authored-by: Zackery Spytz <zspytz@gmail.com>
-rw-r--r--Modules/nismodule.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/Modules/nismodule.c b/Modules/nismodule.c
index 6acab63..e8caea9 100644
--- a/Modules/nismodule.c
+++ b/Modules/nismodule.c
@@ -405,6 +405,7 @@ nis_maps (PyObject *self, PyObject *args, PyObject *kwdict)
PyObject *str = PyString_FromString(maps->map);
if (!str || PyList_Append(list, str) < 0)
{
+ Py_XDECREF(str);
Py_DECREF(list);
list = NULL;
break;