]> granicus.if.org Git - python/commitdiff
Plug a leak with calling something other than a function or method is
authorGuido van Rossum <guido@python.org>
Mon, 27 Jan 1997 21:30:09 +0000 (21:30 +0000)
committerGuido van Rossum <guido@python.org>
Mon, 27 Jan 1997 21:30:09 +0000 (21:30 +0000)
called with keyword arguments -- the keyword and value were leaked.
This affected for instance with a __call__() method.

Bug reported and fix supplied by Jim Fulton.

Python/ceval.c

index 246b9a4e2c23b2966ec4c38434144ad091ba9db5..a59a1c9d8b96e25c6c99e66a810d5afd3d0ddd26 100644 (file)
@@ -1482,11 +1482,10 @@ eval_code2(co, globals, locals,
                                                object *key = POP();
                                                err = mappinginsert(
                                                        kwdict, key, value);
-                                               if (err) {
-                                                       DECREF(key);
-                                                       DECREF(value);
+                                               DECREF(key);
+                                               DECREF(value);
+                                               if (err)
                                                        break;
-                                               }
                                        }
                                        if (err) {
                                                DECREF(args);