From 4bb867d3ec4f004dc35daf9ae935dc72c5214789 Mon Sep 17 00:00:00 2001 From: Benjamin Peterson Date: Tue, 22 Nov 2011 23:12:49 -0600 Subject: plug refleak --- Modules/posixmodule.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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 -- cgit v0.12