mirror of
https://github.com/python/cpython.git
synced 2025-08-01 15:43:13 +00:00
fix possible ref leak
This commit is contained in:
parent
0a6b28ae6a
commit
87e6ad290b
1 changed files with 2 additions and 2 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue