Skip to content
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Assert that mutex is not locked during deallocation
  • Loading branch information
yoney committed Oct 25, 2025
commit 43617f8c591523e329fb84c52cf63cc36507255f
2 changes: 2 additions & 0 deletions Modules/_bz2module.c
Original file line number Diff line number Diff line change
Expand Up @@ -367,6 +367,7 @@ static void
BZ2Compressor_dealloc(PyObject *op)
{
BZ2Compressor *self = _BZ2Compressor_CAST(op);
assert(!PyMutex_IsLocked(&self->mutex));
BZ2_bzCompressEnd(&self->bzs);
PyTypeObject *tp = Py_TYPE(self);
tp->tp_free((PyObject *)self);
Expand Down Expand Up @@ -654,6 +655,7 @@ static void
BZ2Decompressor_dealloc(PyObject *op)
{
BZ2Decompressor *self = _BZ2Decompressor_CAST(op);
assert(!PyMutex_IsLocked(&self->mutex));

if(self->input_buffer != NULL) {
PyMem_Free(self->input_buffer);
Expand Down
Loading