From: Serhiy Storchaka Date: Tue, 3 Jan 2017 09:17:53 +0000 (+0200) Subject: Fixed possible reference leaks in the _json module. X-Git-Tag: v2.7.14rc1~306^2~10 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f04790a4b70bd2f9a2f74c032c3b4a4ffb1a9127;p=thirdparty%2FPython%2Fcpython.git Fixed possible reference leaks in the _json module. --- diff --git a/Modules/_json.c b/Modules/_json.c index 189cb2cb3007..7860e9a6eca4 100644 --- a/Modules/_json.c +++ b/Modules/_json.c @@ -2077,8 +2077,11 @@ encoder_listencode_obj(PyEncoderObject *s, PyObject *rval, PyObject *obj, Py_ssi return -1; } - if (Py_EnterRecursiveCall(" while encoding a JSON object")) + if (Py_EnterRecursiveCall(" while encoding a JSON object")) { + Py_DECREF(newobj); + Py_XDECREF(ident); return -1; + } rv = encoder_listencode_obj(s, rval, newobj, indent_level); Py_LeaveRecursiveCall();