summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorEmily Morehouse <emily@cuttlesoft.com>2017-06-27 16:08:47 (GMT)
committerVictor Stinner <victor.stinner@gmail.com>2017-06-27 16:08:47 (GMT)
commiteb3c52a0d273491e745e0cbff2b73900bb96aa45 (patch)
tree36f65d4d35812a87216dff1d10c2bdef1dd780de /Modules
parentde1850bb03f8225cbff85f437b6e972bf9b68c2a (diff)
downloadcpython-eb3c52a0d273491e745e0cbff2b73900bb96aa45.zip
cpython-eb3c52a0d273491e745e0cbff2b73900bb96aa45.tar.gz
cpython-eb3c52a0d273491e745e0cbff2b73900bb96aa45.tar.bz2
[3.5] bpo-30769: Fix reference leak introduced in 7770394 (GH-2416) (#2447)
Diffstat (limited to 'Modules')
-rw-r--r--Modules/posixmodule.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c
index 042deac..8d32ddf 100644
--- a/Modules/posixmodule.c
+++ b/Modules/posixmodule.c
@@ -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;
}