summaryrefslogtreecommitdiff
path: root/Python/ast.c
diff options
context:
space:
mode:
authorBenjamin Peterson <benjamin@python.org>2012-01-16 09:50:48 -0500
committerBenjamin Peterson <benjamin@python.org>2012-01-16 09:50:48 -0500
commit52c6328874a14ecd14be59a7e88b3977b8fcf07b (patch)
treef6c240b3c06238b43b463cd487bd694143f617cf /Python/ast.c
parente2ad70658b5eb85b2efa295038ab26a9442c290a (diff)
downloadcpython-52c6328874a14ecd14be59a7e88b3977b8fcf07b.tar.gz
fix possible refleaks
Diffstat (limited to 'Python/ast.c')
-rw-r--r--Python/ast.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/Python/ast.c b/Python/ast.c
index 9776a6a151..c70073cdab 100644
--- a/Python/ast.c
+++ b/Python/ast.c
@@ -540,13 +540,15 @@ new_identifier(const char* n, PyArena *arena)
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);