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

[Core] Fix a memory leak when processing MSRP packets #2609

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

jvm7293
Copy link

@jvm7293 jvm7293 commented Sep 26, 2024

The purpose of this PR is to fix a memory leak.
Consider this scenario:

  • msrp_parse_buffer is invoked and it fails to process to parse the message (see line 894) and it leaves the message in the MSRP_ST_WAIT_HEADER state
  • On line 1258 when the message state is analyzed, processing will fall through to the default error case logging ("Parse initial message error!") and then will jump to "end" without destroying the msrg_msg buffer. This will cause a memory leak.

The problem is that in that error check, the msg state is in the MSRP_ST_WAIT_HEADER state which is not explicitly checked and the function exits to "end" without de-allocating the msrp_msg buffer.

@jvm7293 jvm7293 changed the title [switch_msrp.c] This commit fixes a leak in switch_msrp.c [switch_msrp.c] Fix a memory leak in switch_msrp.c Sep 26, 2024
@jvm7293 jvm7293 changed the title [switch_msrp.c] Fix a memory leak in switch_msrp.c Fix a memory leak when processing MSRP packets Sep 26, 2024
@jvm7293 jvm7293 changed the title Fix a memory leak when processing MSRP packets [Core] Fix a memory leak when processing MSRP packets Sep 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant