mirror of
https://github.com/micropython/micropython.git
synced 2026-01-09 05:30:27 +01:00
extmod/modssl_mbedtls: Clear sock member if error creating SSLSocket.
Otherwise if/when the finaliser runs for this newly created SSLSocket the mbedtls state will be freed again. Signed-off-by: Damien George <damien@micropython.org>
This commit is contained in:
@@ -394,6 +394,7 @@ STATIC mp_obj_t ssl_socket_make_new(mp_obj_ssl_context_t *ssl_context, mp_obj_t
|
||||
return MP_OBJ_FROM_PTR(o);
|
||||
|
||||
cleanup:
|
||||
o->sock = MP_OBJ_NULL;
|
||||
mbedtls_ssl_free(&o->ssl);
|
||||
mbedtls_raise_error(ret);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user