From 1a027734af06abf08fcb1c34ee65bdf50d12be4d Mon Sep 17 00:00:00 2001 From: David Cermak Date: Fri, 15 Feb 2019 13:46:51 +0100 Subject: [PATCH] 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. --- components/mdns/mdns.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/components/mdns/mdns.c b/components/mdns/mdns.c index cf16ae6561..84d578b3c2 100644 --- a/components/mdns/mdns.c +++ b/components/mdns/mdns.c @@ -2831,7 +2831,10 @@ void mdns_parse_packet(mdns_rx_packet_t * packet) } } } else { - _mdns_search_result_add_txt(search_result, txt, txt_count, packet->tcpip_if, packet->ip_protocol); + _mdns_result_txt_create(data_ptr, data_len, &txt, &txt_count); + if (txt_count) { + _mdns_search_result_add_txt(search_result, txt, txt_count, packet->tcpip_if, packet->ip_protocol); + } } } else if (ours) { if (parsed_packet->questions && !parsed_packet->probe) {