]> granicus.if.org Git - python/commitdiff
[3.5] bpo-30769: Fix reference leak introduced in 7770394 (GH-2416) (#2447)
authorEmily Morehouse <emily@cuttlesoft.com>
Tue, 27 Jun 2017 16:08:47 +0000 (10:08 -0600)
committerVictor Stinner <victor.stinner@gmail.com>
Tue, 27 Jun 2017 16:08:47 +0000 (18:08 +0200)
Modules/posixmodule.c

index 042deaca6f2bb55b3cb34f904bb7fd9723618027..8d32ddf131ce72c19e61138d5029d108311cde27 100644 (file)
@@ -4969,6 +4969,8 @@ parse_envlist(PyObject* env, Py_ssize_t *envc_ptr)
         /* Search from index 1 because on Windows starting '=' is allowed for
            defining hidden environment variables. */
         if (*k == '\0' || strchr(k + 1, '=') != NULL) {
+            Py_DECREF(key2);
+            Py_DECREF(val2);
             PyErr_SetString(PyExc_ValueError, "illegal environment variable name");
             goto error;
         }