-
Notifications
You must be signed in to change notification settings - Fork 13.3k
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
DNSServer cleanup #5179
Comments
I'm not seeing any leak potential.
It's free() 'd inside the same if {...} statement before any potential return from the method:
If you've got the time, PRs for things like keywords.txt are always appreciated, too. |
Wow, I looked deeper, and you are correct. The code in the Having the destructor call stop would be still be a good thing. Further, there should not be a member at all for the _buffer, since it has a limited lifetime, it should just be passed into the methods that will need it rather than store an extra pointer for the lifetime of the object to just avoid passing an argument. |
@Makuna there's also my ESPAsyncDNSServer in case you're interested. I only mention it because I've received little feedback, andand I'd like some :p |
@Makuna you self-assigned this. Do you intend to get it done within the next few days? |
Basic Infos
DNSServer does not have a destructor which can cause memory leaks if dynamically allocated.
Problem Description
DNSServer needs a destructor. Currently you can destruct the object and leave the internal
_buffer
memory still allocated causing a memory leak.This can be worked around by calling
stop()
before destructing, but this is an unsafe assumption.p.s. This library also lacks the keywords file so there is no pretty colors in the Arduino IDE for the methods.
The text was updated successfully, but these errors were encountered: