Skip to content

Commit

Permalink
gh-116810: fixed memory leak ssl module
Browse files Browse the repository at this point in the history
PySSL_get_session leaks a session object each time
it is called.  For programs like cherrypy (cheroot),
a leak occurs with each handled web request.
  • Loading branch information
jeffvanvoorst committed Aug 23, 2024
1 parent 4c3f0cb commit 119d33a
Showing 1 changed file with 0 additions and 4 deletions.
4 changes: 0 additions & 4 deletions Modules/_ssl.c
Original file line number Diff line number Diff line change
Expand Up @@ -2853,10 +2853,6 @@ PySSL_get_session(PySSLSocket *self, void *closure) {
if ((session = _ssl_session_dup(session)) == NULL) {
return NULL;
}
session = SSL_get1_session(self->ssl);
if (session == NULL) {
Py_RETURN_NONE;
}
pysess = PyObject_GC_New(PySSLSession, self->ctx->state->PySSLSession_Type);
if (pysess == NULL) {
SSL_SESSION_free(session);
Expand Down

0 comments on commit 119d33a

Please sign in to comment.