diff options
author | Benjamin Peterson <benjamin@python.org> | 2009-04-02 02:58:49 +0000 |
---|---|---|
committer | Benjamin Peterson <benjamin@python.org> | 2009-04-02 02:58:49 +0000 |
commit | 945e052accebd4ae920c4d4444f8ccee0c82a32d (patch) | |
tree | 07be942f32377d847fd896b6c27eb2336de3dd54 /Python/symtable.c | |
parent | d9f564f60f47edc55a00cf336e623f1c7c981374 (diff) | |
download | cpython-git-945e052accebd4ae920c4d4444f8ccee0c82a32d.tar.gz |
Merged revisions 71026 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk
........
r71026 | benjamin.peterson | 2009-04-01 21:52:46 -0500 (Wed, 01 Apr 2009) | 1 line
fix error handling
........
Diffstat (limited to 'Python/symtable.c')
-rw-r--r-- | Python/symtable.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/Python/symtable.c b/Python/symtable.c index 1871a420d9..e0b28c9e0d 100644 --- a/Python/symtable.c +++ b/Python/symtable.c @@ -731,7 +731,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. @@ -758,13 +757,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 |