]> granicus.if.org Git - python/commitdiff
bpo-35356: Fix a possible reference leak in nis.maps(). (GH-10808)
authorZackery Spytz <zspytz@gmail.com>
Fri, 30 Nov 2018 07:40:16 +0000 (00:40 -0700)
committerSerhiy Storchaka <storchaka@gmail.com>
Fri, 30 Nov 2018 07:40:16 +0000 (09:40 +0200)
Modules/nismodule.c

index bc6796c278caaa42cc160b21de1964b2ff99b464..a24978e0686705de3785ae5d718323c6b68a8f03 100644 (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;