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 memory leaks if handshake fails #9006

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Conversation

zefir-o
Copy link

@zefir-o zefir-o commented Oct 16, 2023

No description provided.

@mcspr
Copy link
Collaborator

mcspr commented Oct 16, 2023

This way we lose last bearssl error since you delete the context obj with _freeSSL() call. You might want to save result of br_ssl_engine_last_error some place beforehand

int WiFiClientSecureCtx::getLastSSLError(char *dest, size_t len) {

@zefir-o
Copy link
Author

zefir-o commented Oct 16, 2023

This way we lose last bearssl error since you delete the context obj with _freeSSL() call. You might want to save result of br_ssl_engine_last_error some place beforehand

int WiFiClientSecureCtx::getLastSSLError(char *dest, size_t len) {

@mcspr Thank you for the hint. It was done similarly to existing code:

@d-a-v
Copy link
Collaborator

d-a-v commented Mar 25, 2024

@igor-epam What do you think of saving the content of br_ssl_engine_last_error in a "releaseSSL()" method that would also call _freeSSL() ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants