-
Notifications
You must be signed in to change notification settings - Fork 7.6k
Fix memory leak on stream load when updating CA Certificate #6062
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
Conversation
|
Is this still relevant? If so, what is blocking it? Is there anything you can do to help move it forward? This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. |
@VojtechBartoska The memory leak mentioned here is resolved in PR #6387. I agree with adding @me-no-dev setInsecure() is a dangerous function as it doesn't free memory allocated in loadCACert(). But.... Calling loadCACert() after setCACert() may free a pointer that doesn't belong to this module. In my opinion loadCACert(), loadCertificate(), loadPrivateKey() should all have their own private storage variables. Then call free() for each variable in setInsecure() and ~WiFiClientSecure(). |
Changes already implemented. |
Summary
This PR fix a memory leak when reconfiguring CA Certificate with multiple calls to WiFiClientSecure::setCACert()
Impact
When reconfiguring multiple times a CA certificate, or if your systems refresh the connection calling multiple times this function, the system will run out of memory.
Related links
#5826