mirror of
https://github.com/espressif/esp-idf.git
synced 2025-08-02 20:24:32 +02:00
Merge branch 'bugfix/mdns_crash_free_strdup_3.1' into 'release/v3.1'
mdns: fixed crash on free undefined ptr if strdup is skipped (Backport 3.1) See merge request idf/esp-idf!4189
This commit is contained in:
@@ -2575,7 +2575,7 @@ void mdns_parse_packet(mdns_rx_packet_t * packet)
|
|||||||
parsed_packet->discovery = true;
|
parsed_packet->discovery = true;
|
||||||
mdns_srv_item_t * a = _mdns_server->services;
|
mdns_srv_item_t * a = _mdns_server->services;
|
||||||
while (a) {
|
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) {
|
if (!question) {
|
||||||
HOOK_MALLOC_FAILED;
|
HOOK_MALLOC_FAILED;
|
||||||
goto clear_rx_packet;
|
goto clear_rx_packet;
|
||||||
@@ -2603,7 +2603,7 @@ void mdns_parse_packet(mdns_rx_packet_t * packet)
|
|||||||
parsed_packet->probe = true;
|
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) {
|
if (!question) {
|
||||||
HOOK_MALLOC_FAILED;
|
HOOK_MALLOC_FAILED;
|
||||||
goto clear_rx_packet;
|
goto clear_rx_packet;
|
||||||
|
Reference in New Issue
Block a user