]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
plug refleak
authorBenjamin Peterson <benjamin@python.org>
Wed, 23 Nov 2011 05:12:49 +0000 (23:12 -0600)
committerBenjamin Peterson <benjamin@python.org>
Wed, 23 Nov 2011 05:12:49 +0000 (23:12 -0600)
Modules/posixmodule.c

index 728644534d4f54d3e507972ab25f91791914835e..2afd5a6097380a9e3523e99bc190a3d6f092f763 100644 (file)
@@ -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