Skip to content

Commit

Permalink
extmod/modssl_mbedtls: Reference SSLContext from SSLSocket.
Browse files Browse the repository at this point in the history
Prevent the GC cleaning up (and finalising) the SSLContext while the
socket is still live.

Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
  • Loading branch information
jimmo committed Aug 1, 2023
1 parent 01c758e commit 70c5643
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions extmod/modssl_mbedtls.c
Original file line number Diff line number Diff line change
Expand Up @@ -357,6 +357,7 @@ STATIC mp_obj_t ssl_socket_make_new(mp_obj_ssl_context_t *ssl_context, mp_obj_t
mp_obj_ssl_socket_t *o = m_new_obj(mp_obj_ssl_socket_t);
#endif
o->base.type = &ssl_socket_type;
o->ssl_context = ssl_context;
o->sock = sock;
o->poll_mask = 0;
o->last_error = 0;
Expand Down

0 comments on commit 70c5643

Please sign in to comment.