-
Notifications
You must be signed in to change notification settings - Fork 7.7k
Closed
Labels
Status: SolvedThe issue has been resolved and requires no further action.The issue has been resolved and requires no further action.Status: To be implementedSelected for DevelopmentSelected for DevelopmentType: Bug 🐛All bugsAll bugs
Milestone
Description
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
None
Debug Message
None
Other Steps to Reproduce
No response
I have checked existing issues, online documentation and the Troubleshooting Guide
- I confirm I have checked existing issues, online documentation and Troubleshooting guide.To pick up a draggable item, press the space bar. While dragging, use the arrow keys to move the item. Press space again to drop the item in its new position, or press escape to cancel.
Metadata
Metadata
Assignees
Labels
Status: SolvedThe issue has been resolved and requires no further action.The issue has been resolved and requires no further action.Status: To be implementedSelected for DevelopmentSelected for DevelopmentType: Bug 🐛All bugsAll bugs
Type
Projects
Status
Done
Relationships
Development
Select code repository
Activity
mrengineer7777 commentedon Apr 29, 2022
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.
SuGlider commentedon Apr 29, 2022
I think it would be good to review the whole code and fix these similar issues.
Thanks @alex-code for reporting!
alex-code commentedon Apr 29, 2022
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.
SuGlider commentedon May 6, 2022
@alex-code - PR #6707 shall fixes it.
Please let me know if you can confirm that it solves this issue.
alex-code commentedon May 7, 2022
Looks good to me, testing again with the changes the free memory reported before construction is the same after destroying 👍
SuGlider commentedon May 7, 2022
@alex-code - Thanks for testing and confirming the resolution of this issue.