summaryrefslogtreecommitdiffstats
path: root/Objects
diff options
context:
space:
mode:
authorArmin Rigo <arigo@tunes.org>2004-01-27 16:08:07 (GMT)
committerArmin Rigo <arigo@tunes.org>2004-01-27 16:08:07 (GMT)
commit76beca957fbe8cceecabd8e30725b4ea0f0d024f (patch)
tree8a8331edf8d055cd5310131a5ad3cffc0ad9fa4b /Objects
parentd5a21fd387607661a51dc62b7880f8b211c7b79c (diff)
downloadcpython-76beca957fbe8cceecabd8e30725b4ea0f0d024f.zip
cpython-76beca957fbe8cceecabd8e30725b4ea0f0d024f.tar.gz
cpython-76beca957fbe8cceecabd8e30725b4ea0f0d024f.tar.bz2
Two forgotten Py_DECREF() for two out-of-memory conditions.
Diffstat (limited to 'Objects')
-rw-r--r--Objects/frameobject.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/Objects/frameobject.c b/Objects/frameobject.c
index ffe9ec3..1dfded7 100644
--- a/Objects/frameobject.c
+++ b/Objects/frameobject.c
@@ -584,8 +584,10 @@ PyFrame_New(PyThreadState *tstate, PyCodeObject *code, PyObject *globals,
}
if (free_list == NULL) {
f = PyObject_GC_NewVar(PyFrameObject, &PyFrame_Type, extras);
- if (f == NULL)
+ if (f == NULL) {
+ Py_DECREF(builtins);
return NULL;
+ }
}
else {
assert(numfree > 0);
@@ -594,8 +596,10 @@ PyFrame_New(PyThreadState *tstate, PyCodeObject *code, PyObject *globals,
free_list = free_list->f_back;
if (f->ob_size < extras) {
f = PyObject_GC_Resize(PyFrameObject, f, extras);
- if (f == NULL)
+ if (f == NULL) {
+ Py_DECREF(builtins);
return NULL;
+ }
}
_Py_NewReference((PyObject *)f);
}