mirror of
https://github.com/espressif/esp-idf.git
synced 2025-07-31 19:24:33 +02:00
Merge branch 'bugfix/mdns_crash_free_strdup' into 'master'
mdns: fixed crash on free undefined ptr if strdup is skipped See merge request idf/esp-idf!4173
This commit is contained in:
@@ -2590,7 +2590,7 @@ void mdns_parse_packet(mdns_rx_packet_t * packet)
|
||||
parsed_packet->discovery = true;
|
||||
mdns_srv_item_t * a = _mdns_server->services;
|
||||
while (a) {
|
||||
mdns_parsed_question_t * question = (mdns_parsed_question_t *)malloc(sizeof(mdns_parsed_question_t));
|
||||
mdns_parsed_question_t * question = (mdns_parsed_question_t *)calloc(1, sizeof(mdns_parsed_question_t));
|
||||
if (!question) {
|
||||
HOOK_MALLOC_FAILED;
|
||||
goto clear_rx_packet;
|
||||
@@ -2618,7 +2618,7 @@ void mdns_parse_packet(mdns_rx_packet_t * packet)
|
||||
parsed_packet->probe = true;
|
||||
}
|
||||
|
||||
mdns_parsed_question_t * question = (mdns_parsed_question_t *)malloc(sizeof(mdns_parsed_question_t));
|
||||
mdns_parsed_question_t * question = (mdns_parsed_question_t *)calloc(1, sizeof(mdns_parsed_question_t));
|
||||
if (!question) {
|
||||
HOOK_MALLOC_FAILED;
|
||||
goto clear_rx_packet;
|
||||
|
Reference in New Issue
Block a user