From 45370f4fae07e029043d442085ef3f25f04e6bb2 Mon Sep 17 00:00:00 2001 From: "kapil.gupta" Date: Tue, 15 Dec 2020 12:06:10 +0530 Subject: [PATCH] wpa_supplicant: Fix null pointer dereference if eap init failed --- components/wpa_supplicant/src/crypto/tls_mbedtls.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/components/wpa_supplicant/src/crypto/tls_mbedtls.c b/components/wpa_supplicant/src/crypto/tls_mbedtls.c index 409281ff92..45697adde3 100644 --- a/components/wpa_supplicant/src/crypto/tls_mbedtls.c +++ b/components/wpa_supplicant/src/crypto/tls_mbedtls.c @@ -502,6 +502,10 @@ struct tls_connection * tls_connection_init(void *tls_ctx) void tls_connection_deinit(void *tls_ctx, struct tls_connection *conn) { + /* tls init failed case */ + if (!conn) { + return; + } /* Free ssl ctx and data */ tls_mbedtls_conn_delete((tls_context_t *) conn->tls); os_free(conn->tls);