Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions Include/internal/pycore_blocks_output_buffer.h
Original file line number Diff line number Diff line change
Expand Up @@ -242,9 +242,12 @@ static inline PyObject *
_BlocksOutputBuffer_Finish(_BlocksOutputBuffer *buffer,
const Py_ssize_t avail_out)
{
PyObject *obj;
assert(buffer->writer != NULL);
return PyBytesWriter_FinishWithSize(buffer->writer,
buffer->allocated - avail_out);
obj = PyBytesWriter_FinishWithSize(buffer->writer,
buffer->allocated - avail_out);
buffer->writer = NULL;
return obj;
}

/* Clean up the buffer when an error occurred. */
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
:mod:`bz2`, :mod:`compression.zstd`, :mod:`lzma`, :mod:`zlib`: Fix a double
free in on memory allocation failure. Patch by Victor Stinner.
Loading