mirror of
https://github.com/python/cpython.git
synced 2025-07-24 03:35:53 +00:00
A Py_DECREF(f) is missing in PyFrame_New for the error case when
the `builtins' initialization fails. Vladimir Marangozov.
This commit is contained in:
parent
bf338300ff
commit
f61618c98e
1 changed files with 4 additions and 4 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue