From: Guido van Rossum Date: Mon, 19 Oct 1998 14:20:20 +0000 (+0000) Subject: A Py_DECREF(f) is missing in PyFrame_New for the error case when X-Git-Tag: v1.5.2b1~310 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=f61618c98ebdd1f67f9d4b144ccc60e03757ccf6;p=thirdparty%2FPython%2Fcpython.git A Py_DECREF(f) is missing in PyFrame_New for the error case when the `builtins' initialization fails. Vladimir Marangozov. --- diff --git a/Objects/frameobject.c b/Objects/frameobject.c index 5d854455fd0f..64fc52feb984 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);