summaryrefslogtreecommitdiffstats
path: root/Python
diff options
context:
space:
mode:
authorBenjamin Peterson <benjamin@python.org>2009-04-02 02:52:46 (GMT)
committerBenjamin Peterson <benjamin@python.org>2009-04-02 02:52:46 (GMT)
commit985951df7f05b8206c5c928a7783326ea942a874 (patch)
treec646db8ad901f51ac5f057859fe36dfbe5bc7a69 /Python
parent4b5c53aba596f96eebf5b04efad8192f3ff0d4bf (diff)
downloadcpython-985951df7f05b8206c5c928a7783326ea942a874.zip
cpython-985951df7f05b8206c5c928a7783326ea942a874.tar.gz
cpython-985951df7f05b8206c5c928a7783326ea942a874.tar.bz2
fix error handling
Diffstat (limited to 'Python')
-rw-r--r--Python/symtable.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/Python/symtable.c b/Python/symtable.c
index 514ed44..023c933 100644
--- a/Python/symtable.c
+++ b/Python/symtable.c
@@ -732,7 +732,6 @@ analyze_child_block(PySTEntryObject *entry, PyObject *bound, PyObject *free,
PyObject *global, PyObject* child_free)
{
PyObject *temp_bound = NULL, *temp_global = NULL, *temp_free = NULL;
- int success = 0;
/* Copy the bound and global dictionaries.
@@ -759,13 +758,17 @@ analyze_child_block(PySTEntryObject *entry, PyObject *bound, PyObject *free,
if (!analyze_block(entry, temp_bound, temp_free, temp_global))
goto error;
- success = PyDict_Update(child_free, temp_free) >= 0;
- success = 1;
+ if (PyDict_Update(child_free, temp_free) < 0)
+ goto error;
+ Py_DECREF(temp_bound);
+ Py_DECREF(temp_free);
+ Py_DECREF(temp_global);
+ return 1;
error:
Py_XDECREF(temp_bound);
Py_XDECREF(temp_free);
Py_XDECREF(temp_global);
- return success;
+ return 0;
}
static int