Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[mdns]: fix incorrect memory free for mdns browse #740

Merged

Conversation

gytxxsy
Copy link
Contributor

@gytxxsy gytxxsy commented Jan 22, 2025

Description

When parsing an mDNS packet, for mDNS browse:

  1. If _mdns_sync_browse_action(ACTION_BROWSE_SYNC, out_sync_browse) is called, the memory allocated for the browse will be freed by _mdns_sync_browse_result_link_free after processing ACTION_BROWSE_SYNC in _mdns_execute_action. Therefore, the memory should not be freed prematurely at the end of mDNS packet parsing.
  2. If _mdns_sync_browse_action is not called but free the out_sync_browse, it should not be freed again at the end of mDNS packet parsing.

Checklist

Before submitting a Pull Request, please ensure the following:

  • 🚨 This PR does not introduce breaking changes.
  • All CI checks (GH Actions) pass.
  • Documentation is updated as needed. (no functional change)
  • Tests are updated or added as necessary.(no functional change)
  • Git history is clean — commits are squashed to the minimum necessary.

@gytxxsy gytxxsy force-pushed the fix/fix_wrong_mem_free_of_mdns_browse branch from 58b0789 to a7eea5e Compare January 22, 2025 11:48
Copy link
Collaborator

@david-cermak david-cermak left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, but please fix the pre-commit hook

@gytxxsy gytxxsy force-pushed the fix/fix_wrong_mem_free_of_mdns_browse branch from a7eea5e to 4451a8c Compare January 23, 2025 01:12
@david-cermak david-cermak merged commit ebec8ef into espressif:master Jan 23, 2025
83 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants