diff options
author | Benjamin Peterson <benjamin@python.org> | 2008-10-16 21:27:54 (GMT) |
---|---|---|
committer | Benjamin Peterson <benjamin@python.org> | 2008-10-16 21:27:54 (GMT) |
commit | 87e6ad290b086c2d95ef9eb443e175c24b00ae94 (patch) | |
tree | 633dccb27b723c1c332756fa650b99a88913f04a /Modules | |
parent | 0a6b28ae6a8a25745a61d044c299906759145689 (diff) | |
download | cpython-87e6ad290b086c2d95ef9eb443e175c24b00ae94.zip cpython-87e6ad290b086c2d95ef9eb443e175c24b00ae94.tar.gz cpython-87e6ad290b086c2d95ef9eb443e175c24b00ae94.tar.bz2 |
fix possible ref leak
Diffstat (limited to 'Modules')
-rw-r--r-- | Modules/_json.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Modules/_json.c b/Modules/_json.c index 832b1ff..437eab0 100644 --- a/Modules/_json.c +++ b/Modules/_json.c @@ -431,6 +431,7 @@ scanstring_unicode(PyObject *pystr, Py_ssize_t end, int strict) goto bail; } if (PyList_Append(chunks, chunk)) { + Py_DECREF(chunk); goto bail; } Py_DECREF(chunk); @@ -541,8 +542,7 @@ scanstring_unicode(PyObject *pystr, Py_ssize_t end, int strict) if (rval == NULL) { goto bail; } - Py_DECREF(chunks); - chunks = NULL; + Py_CLEAR(chunks); return Py_BuildValue("(Nn)", rval, end); bail: Py_XDECREF(chunks); |