Skip to content

Commit 6af3c8b

Browse files
committed
gh-142438: Added missing GIL release in _PySSL_keylog_callback when keylog_bio is unset
In the early return, threadstate is leaked. We have to release it.
1 parent 726e8e8 commit 6af3c8b

2 files changed

Lines changed: 3 additions & 0 deletions

File tree

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Added a missing GIL release in _PySSL_keylog_callback when keylog_bio is
2+
unset, preventing a leaked GIL in that early-return path.

Modules/_ssl/debughelpers.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,7 @@ _PySSL_keylog_callback(const SSL *ssl, const char *line)
131131
PyThread_type_lock lock = get_state_sock(ssl_obj)->keylog_lock;
132132
assert(lock != NULL);
133133
if (ssl_obj->ctx->keylog_bio == NULL) {
134+
PyGILState_Release(threadstate);
134135
return;
135136
}
136137
/*

0 commit comments

Comments
 (0)