-
Notifications
You must be signed in to change notification settings - Fork 7.6k
DNSServer memory leak #6663
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
Comments
That's true. Several libraries have that issue. However since DNSServer is generally only called once and then remains in memory, it is basically a global allocation. If it really bothers you, write the destructor and submit a PR. |
I think it would be good to review the whole code and fix these similar issues. |
It may typically be used globally but if it allocates memory it should really free it too. I don't mind doing a PR for allocations that need freeing if it'll be useful. |
@alex-code - PR #6707 shall fixes it. |
Looks good to me, testing again with the changes the free memory reported before construction is the same after destroying 👍 |
@alex-code - Thanks for testing and confirming the resolution of this issue. |
Board
DFRobot FireBeetle2
Device Description
None
Hardware Configuration
None
Version
v2.0.2
IDE Name
PlateformIO
Operating System
Win11
Flash frequency
80
PSRAM enabled
no
Upload speed
115200
Description
A project I'm working on uses
DNSServer
on demand and I noticed a memory leak.Memory is allocated in the
DNSServer
class constructor but there's no destructor to free it.https://github.com/espressif/arduino-esp32/blob/master/libraries/DNSServer/src/DNSServer.cpp#L16
https://github.com/espressif/arduino-esp32/blob/master/libraries/DNSServer/src/DNSServer.cpp#L17
Sketch
Debug Message
Other Steps to Reproduce
No response
I have checked existing issues, online documentation and the Troubleshooting Guide
The text was updated successfully, but these errors were encountered: