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 496761 - [PATCH] RTSP message leaks memory when uninitialized
[PATCH] RTSP message leaks memory when uninitialized
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-base
git master
Other Linux
: Normal normal
: 0.10.16
Assigned To: Wim Taymans
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2007-11-14 14:50 UTC by Tommi Myöhänen
Modified: 2007-11-16 11:22 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Patch to rtspmessage.c that fixes the header leak (691 bytes, patch)
2007-11-14 14:51 UTC, Tommi Myöhänen
committed Details | Review

Description Tommi Myöhänen 2007-11-14 14:50:46 UTC
==16700== 6,312 (3,031 direct, 3,281 indirect) bytes in 83 blocks are definitely lost in loss record 23 of 30
==16700==    at 0x4020626: malloc (vg_replace_malloc.c:149)
==16700==    by 0x4280E9C: g_malloc (in /targets/OSSO_1.1_X86/usr/lib/libglib-2.0.so.0.1200.12)
==16700==    by 0x4292428: g_strdup (in /targets/OSSO_1.1_X86/usr/lib/libglib-2.0.so.0.1200.12)
==16700==    by 0x4A59419: gst_rtsp_message_add_header (gstrtspmessage.c:507)
==16700==    by 0x4A56D49: parse_line (gstrtspconnection.c:778)
==16700==    by 0x4A57417: gst_rtsp_connection_receive (gstrtspconnection.c:1054)
==16700==    by 0x4A2D584: gst_rtspsrc_connection_receive (gstrtspsrc.c:1194)
==16700==    by 0x4A2EF12: gst_rtspsrc_send (gstrtspsrc.c:3038)
==16700==    by 0x4A308CF: gst_rtspsrc_pause (gstrtspsrc.c:4325)
==16700==    by 0x4A39490: gst_rtspsrc_change_state (gstrtspsrc.c:4504)
==16700==    by 0x4058DDF: gst_element_change_state (gstelement.c:2362)
==16700==    by 0x4059475: gst_element_set_state_func (gstelement.c:2312)

This happens because only the header array is deleted - not the contents. Each RTSPKeyValue contains a g_strdup'ed value field that needs to be freed too. 

Attached patch fixes this leak.
Comment 1 Tommi Myöhänen 2007-11-14 14:51:25 UTC
Created attachment 99085 [details] [review]
Patch to rtspmessage.c that fixes the header leak
Comment 2 Wim Taymans 2007-11-16 11:22:02 UTC
        Patch by: Tommi Myöhänen <ext-tommi dot myohanen at nokia dot com>

        * gst-libs/gst/rtsp/gstrtspmessage.c: (gst_rtsp_message_unset):
        Fix leaking headers. Fixes #496761.