Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix leak in HTTPSClient #2256

Merged
merged 2 commits into from
Jul 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion libraries/HTTPClient/src/HTTPClient.h
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,11 @@ typedef std::vector<Cookie> CookieJar;
class HTTPClient {
public:
HTTPClient() = default;
~HTTPClient() = default;
~HTTPClient() {
if (_clientMade) {
delete _clientMade;
}
}
HTTPClient(HTTPClient&&) = default;
HTTPClient& operator=(HTTPClient&&) = default;

Expand Down
4 changes: 4 additions & 0 deletions libraries/WiFi/src/WiFiClientSecureBearSSL.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down