From f61618c98ebdd1f67f9d4b144ccc60e03757ccf6 Mon Sep 17 00:00:00 2001 From: Guido van Rossum Date: Mon, 19 Oct 1998 14:20:20 +0000 Subject: A Py_DECREF(f) is missing in PyFrame_New for the error case when the `builtins' initialization fails. Vladimir Marangozov. --- Objects/frameobject.c | 8 ++++---- 1 file 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); -- cgit v0.12