[Python-checkins] cpython (merge 3.2 -> default): Cleanup 'k' when the creation of PySTEntryObject fails. ad3824a90261 used to

christian.heimes python-checkins at python.org
Wed Sep 12 17:59:11 CEST 2012


http://hg.python.org/cpython/rev/5b64fefbc16b
changeset: 79010:5b64fefbc16b
parent: 79007:c1b950541e46
parent: 79009:99ab7006e466
user: Christian Heimes <christian at cheimes.de>
date: Wed Sep 12 17:58:20 2012 +0200
summary:
 Cleanup 'k' when the creation of PySTEntryObject fails. ad3824a90261 used to decref 'k' in too many error cases.
files:
 Python/symtable.c | 4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/Python/symtable.c b/Python/symtable.c
--- a/Python/symtable.c
+++ b/Python/symtable.c
@@ -30,8 +30,10 @@
 if (k == NULL)
 goto fail;
 ste = PyObject_New(PySTEntryObject, &PySTEntry_Type);
- if (ste == NULL)
+ if (ste == NULL) {
+ Py_DECREF(k);
 goto fail;
+ }
 ste->ste_table = st;
 ste->ste_id = k; /* ste owns reference to k */
 
-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list

AltStyle によって変換されたページ (->オリジナル) /