[mdns]: fix incorrect memory free for mdns browse #740
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
When parsing an mDNS packet, for
mDNS browse
:_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 processingACTION_BROWSE_SYNC
in_mdns_execute_action
. Therefore, the memory should not be freed prematurely at the end of mDNS packet parsing._mdns_sync_browse_action
is not called but free theout_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:
Documentation is updated as needed.(no functional change)Tests are updated or added as necessary.(no functional change)