summaryrefslogtreecommitdiffstats
path: root/Modules/posixmodule.c
diff options
context:
space:
mode:
authorBenjamin Peterson <benjamin@python.org>2011-11-23 05:12:49 (GMT)
committerBenjamin Peterson <benjamin@python.org>2011-11-23 05:12:49 (GMT)
commit4bb867d3ec4f004dc35daf9ae935dc72c5214789 (patch)
tree4a3608eb6973e81ebd821c0bf661cc8ffeffdae5 /Modules/posixmodule.c
parent116d6b98bf9c09760269db093f3251a16b6c1e81 (diff)
downloadcpython-4bb867d3ec4f004dc35daf9ae935dc72c5214789.zip
cpython-4bb867d3ec4f004dc35daf9ae935dc72c5214789.tar.gz
cpython-4bb867d3ec4f004dc35daf9ae935dc72c5214789.tar.bz2
plug refleak
Diffstat (limited to 'Modules/posixmodule.c')
-rw-r--r--Modules/posixmodule.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c
index 7286445..2afd5a6 100644
--- a/Modules/posixmodule.c
+++ b/Modules/posixmodule.c
@@ -6193,8 +6193,10 @@ posix_unsetenv(PyObject *self, PyObject *args)
s1 = PyBytes_AsString(os1);
err = unsetenv(s1);
- if (err)
+ if (err) {
+ Py_DECREF(s1);
return posix_error();
+ }
/* Remove the key from posix_putenv_garbage;
* this will cause it to be collected. This has to