[Python-checkins] cpython: fix possible refleaks

benjamin.peterson python-checkins at python.org
Mon Jan 16 15:54:35 CET 2012


http://hg.python.org/cpython/rev/5ef589e38985
changeset: 74445:5ef589e38985
user: Benjamin Peterson <benjamin at python.org>
date: Mon Jan 16 09:50:48 2012 -0500
summary:
 fix possible refleaks
files:
 Python/ast.c | 6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/Python/ast.c b/Python/ast.c
--- a/Python/ast.c
+++ b/Python/ast.c
@@ -540,13 +540,15 @@
 if (PyUnicode_IS_ASCII(id)) {
 PyObject *m = PyImport_ImportModuleNoBlock("unicodedata");
 PyObject *id2;
- if (!m)
+ if (!m) {
+ Py_DECREF(id);
 return NULL;
+ }
 id2 = _PyObject_CallMethodId(m, &PyId_normalize, "sO", "NFKC", id);
 Py_DECREF(m);
+ Py_DECREF(id);
 if (!id2)
 return NULL;
- Py_DECREF(id);
 id = id2;
 }
 PyUnicode_InternInPlace(&id);
-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list

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