mirror of
https://github.com/python/cpython.git
synced 2025-09-26 18:29:57 +00:00
Two forgotten Py_DECREF() for two out-of-memory conditions.
This commit is contained in:
parent
d5a21fd387
commit
76beca957f
1 changed files with 6 additions and 2 deletions
|
@ -584,9 +584,11 @@ PyFrame_New(PyThreadState *tstate, PyCodeObject *code, PyObject *globals,
|
||||||
}
|
}
|
||||||
if (free_list == NULL) {
|
if (free_list == NULL) {
|
||||||
f = PyObject_GC_NewVar(PyFrameObject, &PyFrame_Type, extras);
|
f = PyObject_GC_NewVar(PyFrameObject, &PyFrame_Type, extras);
|
||||||
if (f == NULL)
|
if (f == NULL) {
|
||||||
|
Py_DECREF(builtins);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
else {
|
else {
|
||||||
assert(numfree > 0);
|
assert(numfree > 0);
|
||||||
--numfree;
|
--numfree;
|
||||||
|
@ -594,9 +596,11 @@ PyFrame_New(PyThreadState *tstate, PyCodeObject *code, PyObject *globals,
|
||||||
free_list = free_list->f_back;
|
free_list = free_list->f_back;
|
||||||
if (f->ob_size < extras) {
|
if (f->ob_size < extras) {
|
||||||
f = PyObject_GC_Resize(PyFrameObject, f, extras);
|
f = PyObject_GC_Resize(PyFrameObject, f, extras);
|
||||||
if (f == NULL)
|
if (f == NULL) {
|
||||||
|
Py_DECREF(builtins);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
_Py_NewReference((PyObject *)f);
|
_Py_NewReference((PyObject *)f);
|
||||||
}
|
}
|
||||||
f->f_builtins = builtins;
|
f->f_builtins = builtins;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue