Commit c881f159 authored by Antoine Pitrou's avatar Antoine Pitrou

Issue #9448: Fix a leak of OS resources (mutexes or semaphores) when

re-initializing a buffered IO object by calling its `__init__` method.
parent e6c5950a
......@@ -29,6 +29,9 @@ Extensions
Library
-------
- Issue #9448: Fix a leak of OS resources (mutexes or semaphores) when
re-initializing a buffered IO object by calling its ``__init__`` method.
- Issue #1713: Fix os.path.ismount(), which returned true for symbolic links
across devices.
......
......@@ -636,6 +636,8 @@ _buffered_init(buffered *self)
return -1;
}
#ifdef WITH_THREAD
if (self->lock)
PyThread_free_lock(self->lock);
self->lock = PyThread_allocate_lock();
if (self->lock == NULL) {
PyErr_SetString(PyExc_RuntimeError, "can't allocate read lock");
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment