After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 796830 - webrtcbin: Memory leak when validating SDP
webrtcbin: Memory leak when validating SDP
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-bad
git master
Other All
: Normal normal
: 1.15.1
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2018-07-18 16:23 UTC by Luis de Bethencourt
Modified: 2018-07-19 17:40 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
patch fix (755 bytes, patch)
2018-07-18 16:23 UTC, Luis de Bethencourt
committed Details | Review

Description Luis de Bethencourt 2018-07-18 16:23:31 UTC
Created attachment 373086 [details] [review]
patch fix

The GError after validating the SDP doesn't get freed.

Found when running a webrtcbin pipeline inside valgrind:
==5764== 176 (32 direct, 144 indirect) bytes in 2 blocks are definitely lost in loss record 3,017 of 3,165
==5764==    at 0x402E110: malloc (vg_replace_malloc.c:299)
==5764==    by 0x4A84FE8: g_malloc (gmem.c:94)
==5764==    by 0x4AA1B1F: g_slice_alloc (gslice.c:1025)
==5764==    by 0x4A6421B: g_error_new_valist (gerror.c:408)
==5764==    by 0x4A645D3: g_set_error (gerror.c:582)
==5764==    by 0x7A8E4B0: _check_valid_state_for_sdp_change (webrtcsdp.c:88)
==5764==    by 0x7A8E4B0: validate_sdp (webrtcsdp.c:291)
==5764==    by 0x7A867AE: _set_description_task (gstwebrtcbin.c:2293)
==5764==    by 0x7A7E9A9: _execute_op (gstwebrtcbin.c:580)
==5764==    by 0x4A7E90C: g_main_dispatch (gmain.c:3201)
==5764==    by 0x4A7E90C: g_main_context_dispatch (gmain.c:3854)
==5764==    by 0x4A7ECC7: g_main_context_iterate.isra.29 (gmain.c:3927)
==5764==    by 0x4A7EFE1: g_main_loop_run (gmain.c:4123)
==5764==    by 0x7A7EAF9: _gst_pc_thread (gstwebrtcbin.c:531)
Comment 1 Tim-Philipp Müller 2018-07-19 13:52:50 UTC
Thanks for the patch, pushed:

commit 1b095e9609ef6f4a197c1fcfa662c4dc6fcea219 (HEAD -> master)
Author: Sam Gigliotti <samgig@amazon.com>
Date:   Wed Jul 18 14:26:17 2018 +0100

    webrtc: fix memory leak
    
    When it parses SDP, it doesn't free the error object.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=796830

I changed the g_error_free() to a g_clear_error() so the error gets NULL-ed as well (makes it more resilient to future code changes).
Comment 2 Luis de Bethencourt 2018-07-19 17:40:26 UTC
Thanks Tim! :)