From 6d809562ec3cdb3004746654983b04784c1c6b60 Mon Sep 17 00:00:00 2001 From: igor-epam <38714065+igor-epam@users.noreply.github.com> Date: Mon, 16 Oct 2023 10:01:26 +0300 Subject: [PATCH] Fix memory leaks if handshake fails --- libraries/ESP8266WiFi/src/WiFiClientSecureBearSSL.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/libraries/ESP8266WiFi/src/WiFiClientSecureBearSSL.cpp b/libraries/ESP8266WiFi/src/WiFiClientSecureBearSSL.cpp index 7bc0c70df6..9d694f731e 100644 --- a/libraries/ESP8266WiFi/src/WiFiClientSecureBearSSL.cpp +++ b/libraries/ESP8266WiFi/src/WiFiClientSecureBearSSL.cpp @@ -1208,6 +1208,7 @@ bool WiFiClientSecureCtx::_connectSSL(const char* hostName) { // reduce timeout after successful handshake to fail fast if server stop accepting our data for whathever reason if (ret) _timeout = 5000; + else _freeSSL(); return ret; }