mirror of
https://github.com/python/cpython.git
synced 2025-12-08 06:10:17 +00:00
gh-140939: Fix memory leak in _PyBytes_FormatEx error path (#140957)
This commit is contained in:
parent
9037a386c6
commit
d6c89a2df2
3 changed files with 10 additions and 0 deletions
|
|
@ -985,6 +985,7 @@ _PyBytes_FormatEx(const char *format, Py_ssize_t format_len,
|
|||
if (alloc > 2) {
|
||||
res = PyBytesWriter_GrowAndUpdatePointer(writer, alloc - 2, res);
|
||||
if (res == NULL) {
|
||||
Py_XDECREF(temp);
|
||||
goto error;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue