GNOME Bugzilla – Bug 496773
[rtspsrc] leaks SDP messages
Last modified: 2007-11-16 09:43:44 UTC
==19310== 4,806 (1,525 direct, 3,281 indirect) bytes in 32 blocks are definitely lost in loss record 21 of 28 ==19310== at 0x4020626: malloc (vg_replace_malloc.c:149) ==19310== by 0x4280E9C: g_malloc (in /targets/OSSO_1.1_X86/usr/lib/libglib-2.0.so.0.1200.12) ==19310== by 0x429138A: g_slice_alloc (in /targets/OSSO_1.1_X86/usr/lib/libglib-2.0.so.0.1200.12) ==19310== by 0x425AC18: g_array_sized_new (in /targets/OSSO_1.1_X86/usr/lib/libglib-2.0.so.0.1200.12) ==19310== by 0x425ACD4: g_array_new (in /targets/OSSO_1.1_X86/usr/lib/libglib-2.0.so.0.1200.12) ==19310== by 0x45FA163: gst_sdp_message_init (gstsdpmessage.c:240) ==19310== by 0x4833C58: gst_rtspsrc_open (gstrtspsrc.c:3818) ==19310== by 0x483953A: gst_rtspsrc_change_state (gstrtspsrc.c:4476) ==19310== by 0x4058DDF: gst_element_change_state (gstelement.c:2362) ==19310== by 0x4058A2B: gst_element_continue_state (gstelement.c:2077) ==19310== by 0x4058EC8: gst_element_change_state (gstelement.c:2406) ==19310== by 0x4059475: gst_element_set_state_func (gstelement.c:2312) SDP messages are parsed, but not freed. Attached patch fixes this.
Created attachment 99089 [details] [review] Patch that fixes rtspsrc from leaking SDP messages
That patch doesn't look right, the message hasn't been allocated dynamically but sits on the stack, gst_sdp_message_uninit() should be used instead as far as I can tell: 2007-11-14 Tim-Philipp Müller <tim at centricular dot net> * gst/rtsp/gstrtspsrc.c: (gst_rtspsrc_open): Don't leak sdp message contents (fixes #496773). * gst/udp/gstudpsink.c: (gst_udpsink_finalize): Don't leak URI string. Please re-open if this is incorrect.
Oh yes, it needs to be gst_sdp_message_uninit(). My mistake. Your fix is correct!