Skip to content
Prev Previous commit
Next Next commit
Fix memory leak in SSLProtocol and test_create_connection_memory_leak…
… test
  • Loading branch information
taras
taras committed Jan 31, 2026
commit 58ce0be749305958bfe743236c401a577cba53f2
5 changes: 5 additions & 0 deletions uvloop/sslproto.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -350,6 +350,9 @@ cdef class SSLProtocol:
self._transport = None
self._app_transport = None
self._app_protocol = None
self._app_protocol_get_buffer = None
self._app_protocol_data_received = None
self._app_protocol_buffer_updated = None
self._wakeup_waiter(exc)

if self._shutdown_timeout_handle:
Expand Down Expand Up @@ -860,6 +863,8 @@ cdef class SSLProtocol:
elif first_chunk is not None:
self._app_protocol_data_received(first_chunk)

# SSLObject.read() may return 0 instead of throwing SSLWantReadError
# This indicates that we reached EOF
if bytes_read == 0:
# close_notify
self._call_eof_received()
Expand Down
Loading