From: Benjamin Peterson Date: Mon, 16 Jan 2012 14:50:48 +0000 (-0500) Subject: fix possible refleaks X-Git-Tag: v3.3.0a1~383 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=0fa35ea8f39b0ab292ba6cab2fa312cf18d3daf9;p=thirdparty%2FPython%2Fcpython.git fix possible refleaks --- diff --git a/Python/ast.c b/Python/ast.c index 9776a6a15151..c70073cdab5b 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);