diff options
author | Benjamin Peterson <benjamin@python.org> | 2012-01-16 14:50:48 (GMT) |
---|---|---|
committer | Benjamin Peterson <benjamin@python.org> | 2012-01-16 14:50:48 (GMT) |
commit | 0fa35ea8f39b0ab292ba6cab2fa312cf18d3daf9 (patch) | |
tree | 386e45c86c9602de4b79df872dd8e77d2e4eb65c | |
parent | 89f8b802026b4e45c692db05107100eaad1c888d (diff) | |
download | cpython-0fa35ea8f39b0ab292ba6cab2fa312cf18d3daf9.zip cpython-0fa35ea8f39b0ab292ba6cab2fa312cf18d3daf9.tar.gz cpython-0fa35ea8f39b0ab292ba6cab2fa312cf18d3daf9.tar.bz2 |
fix possible refleaks
-rw-r--r-- | Python/ast.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/Python/ast.c b/Python/ast.c index 9776a6a..c70073c 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); |