Skip to content

Commit 90e4bab

Browse files
mdns: fix malfuctional query_txt
when running a query for a single txt, result entries were not created and attached to result structure. this issue was introduced when fixing memory leak in txt structure, which worked correctly for PTR queries, but caused trouble for TXT query. * Original commit: espressif/esp-idf@1a02773
1 parent c546ab8 commit 90e4bab

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

components/mdns/mdns.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2831,7 +2831,10 @@ void mdns_parse_packet(mdns_rx_packet_t * packet)
28312831
}
28322832
}
28332833
} else {
2834-
_mdns_search_result_add_txt(search_result, txt, txt_count, packet->tcpip_if, packet->ip_protocol);
2834+
_mdns_result_txt_create(data_ptr, data_len, &txt, &txt_count);
2835+
if (txt_count) {
2836+
_mdns_search_result_add_txt(search_result, txt, txt_count, packet->tcpip_if, packet->ip_protocol);
2837+
}
28352838
}
28362839
} else if (ours) {
28372840
if (parsed_packet->questions && !parsed_packet->probe) {

0 commit comments

Comments
 (0)