mirror of
https://github.com/0xFEEDC0DE64/arduino-esp32.git
synced 2025-07-13 10:46:31 +02:00
Fixes DNS Server Memory Leak when deleted (#6707)
This commit is contained in:
@ -20,6 +20,22 @@ DNSServer::DNSServer()
|
|||||||
_port = 0;
|
_port = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
DNSServer::~DNSServer()
|
||||||
|
{
|
||||||
|
if (_dnsHeader) {
|
||||||
|
free(_dnsHeader);
|
||||||
|
_dnsHeader = NULL;
|
||||||
|
}
|
||||||
|
if (_dnsQuestion) {
|
||||||
|
free(_dnsQuestion);
|
||||||
|
_dnsQuestion = NULL;
|
||||||
|
}
|
||||||
|
if (_buffer) {
|
||||||
|
free(_buffer);
|
||||||
|
_buffer = NULL;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
bool DNSServer::start(const uint16_t &port, const String &domainName,
|
bool DNSServer::start(const uint16_t &port, const String &domainName,
|
||||||
const IPAddress &resolvedIP)
|
const IPAddress &resolvedIP)
|
||||||
{
|
{
|
||||||
|
@ -76,6 +76,7 @@ class DNSServer
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
DNSServer();
|
DNSServer();
|
||||||
|
~DNSServer();
|
||||||
void processNextRequest();
|
void processNextRequest();
|
||||||
void setErrorReplyCode(const DNSReplyCode &replyCode);
|
void setErrorReplyCode(const DNSReplyCode &replyCode);
|
||||||
void setTTL(const uint32_t &ttl);
|
void setTTL(const uint32_t &ttl);
|
||||||
|
Reference in New Issue
Block a user