diff --git a/components/wpa_supplicant/src/crypto/tls_mbedtls.c b/components/wpa_supplicant/src/crypto/tls_mbedtls.c index 1185db8038..dc00fa4897 100644 --- a/components/wpa_supplicant/src/crypto/tls_mbedtls.c +++ b/components/wpa_supplicant/src/crypto/tls_mbedtls.c @@ -510,6 +510,10 @@ struct tls_connection * tls_connection_init(void *tls_ctx) void tls_connection_deinit(void *tls_ctx, struct tls_connection *conn) { + /* case: tls init failed */ + if(!conn) { + return; + } /* Free ssl ctx and data */ tls_mbedtls_conn_delete((tls_context_t *) conn->tls); os_free(conn->tls);