-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Fixed memory leak in janus_sdp_get_codec_pt_full (0.x branch) #3371
Conversation
Thanks for your contribution, @vincentfretin! Please make sure you sign our CLA, as it's a required step before we can merge this. |
That's a good catch, and I think there's indeed a leak in those cases. This should be done for |
Ok, I removed the NULL check, but I didn't test that. |
I tested it, it doesn't crash, so I guess @arpu will do some tests to see if this fixes the direct leak he had. |
I think those parts of the codes are only involved when using VP9 and/or H.264 profiles, so forcing those (e.g., in the VideoRoom) should help test the changes more quickly. |
i can confirm this fixed the |
…s not called for early return
93126a6
to
502c14a
Compare
I squashed the two commits into one and made the same changes for master branch in #3373 |
Actually, for files that are pretty much the same (and apart for a few major changes, Anyway, looks good to me, thanks! I'll merge both PRs. |
Fixed memory leak in
janus_sdp_get_codec_pt_full
,g_list_free(pts)
is not called for early return. This PR is against the 0.x branch.@arpu in #3367 produced this stacktrace for the rust plugin, but as far as I can see this is not a rust issue here.
janus-gateway/sdp-utils.c
Line 736 in a7767ad
pts = g_list_append(pts, GINT_TO_POINTER(pt))
is doing ag_malloc
, but in this particular stacktrace it's not freed, my guess is thatg_list_free(pts)
is not calledjanus-gateway/sdp-utils.c
Line 792 in a7767ad
g_list_free(pts)
, probablyjanus-gateway/sdp-utils.c
Line 775 in a7767ad
I didn't reproduce the leak myself, it probably depends on the sdp offer the browser send, so I can't know for sure the changes I propose here is fixing the issue.