From: Stefan Krah Date: Mon, 27 Jul 2015 10:56:49 +0000 (+0200) Subject: Fix refleak. X-Git-Tag: v3.6.0a1~1902^2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=c0cbed15543cb48df70fec9680d58ae3454eaf4f;p=python Fix refleak. --- diff --git a/Python/compile.c b/Python/compile.c index 027e3abe68..cfeab0fdfe 100644 --- a/Python/compile.c +++ b/Python/compile.c @@ -1146,8 +1146,10 @@ compiler_add_o(struct compiler *c, PyObject *dict, PyObject *o) v = PyDict_GetItem(dict, t); if (!v) { - if (PyErr_Occurred()) + if (PyErr_Occurred()) { + Py_DECREF(t); return -1; + } arg = PyDict_Size(dict); v = PyLong_FromSsize_t(arg); if (!v) {