mirror of
https://github.com/espressif/esp-idf.git
synced 2024-10-05 20:47:46 -04:00
mdns: fix memory leak when query for service receives multiple ptr entries for one instance
fixes redmine issue 27300
This commit is contained in:
parent
bc58f4b9ba
commit
1ce0434373
@ -2726,8 +2726,10 @@ void mdns_parse_packet(mdns_rx_packet_t * packet)
|
||||
|
||||
if (search_result) {
|
||||
if (search_result->type == MDNS_TYPE_PTR) {
|
||||
result->port = port;
|
||||
result->hostname = strdup(name->host);
|
||||
if (!result->hostname) { // assign host/port for this entry only if not previously set
|
||||
result->port = port;
|
||||
result->hostname = strdup(name->host);
|
||||
}
|
||||
} else {
|
||||
_mdns_search_result_add_srv(search_result, name->host, port, packet->tcpip_if, packet->ip_protocol);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user