Mercurial > cpython-lru_cache-weakref
diff Python/ast.c @ 74445:5ef589e38985
fix possible refleaks
| author | Benjamin Peterson <benjamin@python.org> |
|---|---|
| date | Mon, 16 Jan 2012 09:50:48 -0500 |
| parents | fe40a87484cc |
| children | ca5c5142da58 |
line wrap: on
line diff
--- a/Python/ast.c Mon Jan 16 09:49:20 2012 -0500 +++ b/Python/ast.c Mon Jan 16 09:50:48 2012 -0500 @@ -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);
