kopia lustrzana https://github.com/micropython/micropython
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>pull/12286/head
rodzic
f3eccb154c
commit
313068a5b3
|
@ -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);
|
||||
}
|
||||
|
|
Ładowanie…
Reference in New Issue