]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
DECREF result of run_string
authorGuido van Rossum <guido@python.org>
Tue, 7 Feb 1995 15:36:56 +0000 (15:36 +0000)
committerGuido van Rossum <guido@python.org>
Tue, 7 Feb 1995 15:36:56 +0000 (15:36 +0000)
Python/ceval.c

index ff055e452e1f8812043cec8d8a72288f7635ae23..48fce5b6138369f03c54e7cc3d0abdbe56ac4b32 100644 (file)
@@ -782,7 +782,6 @@ eval_code(co, globals, locals, owner, arg)
                                u = w;
                                w = gettupleitem(u, 0);
                                INCREF(w);
-                               INCREF(w);
                                DECREF(u);
                        }
                        if (is_stringobject(w)) {
@@ -2657,6 +2656,7 @@ exec_statement(prog, globals, locals)
 {
        char *s;
        int n;
+       object *v;
 
        if (is_tupleobject(prog) && globals == None && locals == None &&
            ((n = gettuplesize(prog)) == 2 || n == 3)) {
@@ -2705,7 +2705,8 @@ exec_statement(prog, globals, locals)
                err_setstr(ValueError, "embedded '\\0' in exec string");
                return -1;
        }
-       if (run_string(s, file_input, globals, locals) == NULL)
+       if ((v = run_string(s, file_input, globals, locals)) == NULL)
                return -1;
+       DECREF(v);
        return 0;
 }