Commit 76beca95 authored by Armin Rigo's avatar Armin Rigo

Two forgotten Py_DECREF() for two out-of-memory conditions.

parent d5a21fd3
...@@ -584,8 +584,10 @@ PyFrame_New(PyThreadState *tstate, PyCodeObject *code, PyObject *globals, ...@@ -584,8 +584,10 @@ 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);
...@@ -594,8 +596,10 @@ PyFrame_New(PyThreadState *tstate, PyCodeObject *code, PyObject *globals, ...@@ -594,8 +596,10 @@ 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);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment