Skip to content

Commit f3fe21a

Browse files
bpo-35356: Fix a possible reference leak in nis.maps(). (GH-10808)
(cherry picked from commit a2e3585) Co-authored-by: Zackery Spytz <zspytz@gmail.com>
1 parent f681e93 commit f3fe21a

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

Modules/nismodule.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -405,6 +405,7 @@ nis_maps (PyObject *self, PyObject *args, PyObject *kwdict)
405405
PyObject *str = PyString_FromString(maps->map);
406406
if (!str || PyList_Append(list, str) < 0)
407407
{
408+
Py_XDECREF(str);
408409
Py_DECREF(list);
409410
list = NULL;
410411
break;

0 commit comments

Comments
 (0)