fix(mdns): added guard check for null pointer
This commit is contained in:
parent
5143f5ac01
commit
71bb461ed8
1 changed files with 1 additions and 1 deletions
|
|
@ -5850,7 +5850,7 @@ static mdns_txt_item_t *_copy_mdns_txt_items(mdns_txt_linked_item_t *items, uint
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
handle_error:
|
handle_error:
|
||||||
for (size_t y = 0; y < ret_index + 1; y++) {
|
for (size_t y = 0; y < ret_index + 1 && ret != NULL; y++) {
|
||||||
mdns_txt_item_t *t = &ret[y];
|
mdns_txt_item_t *t = &ret[y];
|
||||||
free((char *)t->key);
|
free((char *)t->key);
|
||||||
free((char *)t->value);
|
free((char *)t->value);
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue