diff --git a/libraries/HTTPClient/src/HTTPClient.h b/libraries/HTTPClient/src/HTTPClient.h index 3136200b5..999279a47 100644 --- a/libraries/HTTPClient/src/HTTPClient.h +++ b/libraries/HTTPClient/src/HTTPClient.h @@ -179,7 +179,11 @@ typedef std::vector CookieJar; class HTTPClient { public: HTTPClient() = default; - ~HTTPClient() = default; + ~HTTPClient() { + if (_clientMade) { + delete _clientMade; + } + } HTTPClient(HTTPClient&&) = default; HTTPClient& operator=(HTTPClient&&) = default; diff --git a/libraries/WiFi/src/WiFiClientSecureBearSSL.cpp b/libraries/WiFi/src/WiFiClientSecureBearSSL.cpp index a3b59d8b3..9bfefd975 100644 --- a/libraries/WiFi/src/WiFiClientSecureBearSSL.cpp +++ b/libraries/WiFi/src/WiFiClientSecureBearSSL.cpp @@ -123,6 +123,10 @@ WiFiClientSecureCtx::~WiFiClientSecureCtx() { _client->unref(); _client = nullptr; } + if (_esp32_ta) { + delete _esp32_ta; + } + _cipher_list = nullptr; // std::shared will free if last reference _freeSSL(); stack_thunk_del_ref();