bpo-35356: Fix a possible reference leak in nis.maps(). (GH-10808)

This commit is contained in:
Zackery Spytz 2018-11-30 00:40:16 -07:00 committed by Serhiy Storchaka
parent 9724348b43
commit a2e3585e79
1 changed files with 1 additions and 0 deletions

View File

@ -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;