summaryrefslogtreecommitdiffstats
path: root/Modules/nismodule.c
diff options
context:
space:
mode:
authorZackery Spytz <zspytz@gmail.com>2018-11-30 07:40:16 (GMT)
committerSerhiy Storchaka <storchaka@gmail.com>2018-11-30 07:40:16 (GMT)
commita2e3585e79c93b2372dbad46a744e28fcc6dad6d (patch)
tree1456c0b4ca895914e07abe046fee8491d0363a4c /Modules/nismodule.c
parent9724348b43a9005a449ba532ccd3c6726f031097 (diff)
downloadcpython-a2e3585e79c93b2372dbad46a744e28fcc6dad6d.zip
cpython-a2e3585e79c93b2372dbad46a744e28fcc6dad6d.tar.gz
cpython-a2e3585e79c93b2372dbad46a744e28fcc6dad6d.tar.bz2
bpo-35356: Fix a possible reference leak in nis.maps(). (GH-10808)
Diffstat (limited to 'Modules/nismodule.c')
-rw-r--r--Modules/nismodule.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/Modules/nismodule.c b/Modules/nismodule.c
index bc6796c..a24978e 100644
--- a/Modules/nismodule.c
+++ b/Modules/nismodule.c
@@ -412,6 +412,7 @@ nis_maps (PyObject *self, PyObject *args, PyObject *kwdict)
PyObject *str = PyUnicode_FromString(maps->map);
if (!str || PyList_Append(list, str) < 0)
{
+ Py_XDECREF(str);
Py_DECREF(list);
list = NULL;
break;