Merged revisions 66938,66942 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk ........ r66938 | benjamin.peterson | 2008-10-16 16:27:54 -0500 (Thu, 16 Oct 2008) | 1 line fix possible ref leak ........ r66942 | benjamin.peterson | 2008-10-16 16:48:06 -0500 (Thu, 16 Oct 2008) | 1 line fix more possible ref leaks in _json and use Py_CLEAR ........
This commit is contained in:
parent
a13d475901
commit
8e8c2152fb
|
@ -276,6 +276,7 @@ scanstring_str(PyObject *pystr, Py_ssize_t end, char *encoding, int strict)
|
|||
goto bail;
|
||||
}
|
||||
if (PyList_Append(chunks, chunk)) {
|
||||
Py_DECREF(chunk);
|
||||
goto bail;
|
||||
}
|
||||
Py_DECREF(chunk);
|
||||
|
@ -377,6 +378,7 @@ scanstring_str(PyObject *pystr, Py_ssize_t end, char *encoding, int strict)
|
|||
goto bail;
|
||||
}
|
||||
if (PyList_Append(chunks, chunk)) {
|
||||
Py_DECREF(chunk);
|
||||
goto bail;
|
||||
}
|
||||
Py_DECREF(chunk);
|
||||
|
@ -386,8 +388,7 @@ scanstring_str(PyObject *pystr, Py_ssize_t end, char *encoding, 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);
|
||||
|
@ -436,6 +437,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);
|
||||
|
@ -537,6 +539,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);
|
||||
|
@ -546,8 +549,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);
|
||||
|
|
Loading…
Reference in New Issue