]> granicus.if.org Git - python/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 6555f1f511ca7f2d396ed0795aa6c6b966b44f71..ac511fcee528b6b47d7afb8211fc8036964d4556 100644 (file)
@@ -7050,8 +7050,10 @@ posix_unsetenv(PyObject *self, PyObject *args)
         return NULL;
 
     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