commit | e8eb0e82f314f69dda60530480f3234b73466078 | [log] [tgz] |
---|---|---|
author | Benjamin Peterson <benjamin@python.org> | Tue Nov 22 23:14:47 2011 -0600 |
committer | Benjamin Peterson <benjamin@python.org> | Tue Nov 22 23:14:47 2011 -0600 |
tree | 8fec8354b48b421906507f13efca519ab337acc2 | |
parent | e0bcca510ad2af33d1d62a922d8c3d36400f8bcf [diff] [blame] | |
parent | 4bb867d3ec4f004dc35daf9ae935dc72c5214789 [diff] [blame] |
merge 3.2
diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c index 094d071..e42db5b 100644 --- a/Modules/posixmodule.c +++ b/Modules/posixmodule.c
@@ -7844,12 +7844,16 @@ int err; if (!PyArg_ParseTuple(args, "O&:unsetenv", + PyUnicode_FSConverter, &name)) return NULL; + err = unsetenv(PyBytes_AS_STRING(name)); - if (err) + if (err) { + Py_DECREF(name); return posix_error(); + } /* Remove the key from posix_putenv_garbage; * this will cause it to be collected. This has to