diff options
author | Guido van Rossum <guido@python.org> | 1998-10-19 14:20:20 (GMT) |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 1998-10-19 14:20:20 (GMT) |
commit | f61618c98ebdd1f67f9d4b144ccc60e03757ccf6 (patch) | |
tree | ce2c380b445648886d62d18bf8d34d621f3d0cc0 /Objects | |
parent | bf338300ff50bef79b774f0ab956db7cea260c80 (diff) | |
download | cpython-f61618c98ebdd1f67f9d4b144ccc60e03757ccf6.zip cpython-f61618c98ebdd1f67f9d4b144ccc60e03757ccf6.tar.gz cpython-f61618c98ebdd1f67f9d4b144ccc60e03757ccf6.tar.bz2 |
A Py_DECREF(f) is missing in PyFrame_New for the error case when
the `builtins' initialization fails. Vladimir Marangozov.
Diffstat (limited to 'Objects')
-rw-r--r-- | Objects/frameobject.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/Objects/frameobject.c b/Objects/frameobject.c index 5d85445..64fc52f 100644 --- a/Objects/frameobject.c +++ b/Objects/frameobject.c @@ -204,11 +204,11 @@ PyFrame_New(tstate, code, globals, locals) if (builtins == NULL) { /* No builtins! Make up a minimal one. */ builtins = PyDict_New(); - if (builtins == NULL) - return NULL; - /* Give them 'None', at least. */ - if (PyDict_SetItemString(builtins, "None", Py_None) < 0) + if (builtins == NULL || /* Give them 'None', at least. */ + PyDict_SetItemString(builtins, "None", Py_None) < 0) { + Py_DECREF(f); return NULL; + } } else Py_XINCREF(builtins); |