GNOME Bugzilla – Bug 385292
[rmdemux] stream index leaked on shutdown
Last modified: 2006-12-14 11:27:04 UTC
Please describe the problem: When parsing an index header chunk gst_rmdemux_parse_indx_data() uses g_malloc() to allocate a GstRMDemuxIndex structure and stores the pointer in the relevant GstRMDemuxStream structure in GstRMDemux. However, in gst_rmdemux_reset() only the pointers to GstRMDemuxStream are freed (using g_free()) and any pointer these structures contain are leaked. Steps to reproduce: 1. Play http://samples.mplayerhq.hu/real/AC-sipr/autahi-vox.rm in any app that uses GStreamer under valgrind. Actual results: ==22890== 1729 (1644 direct, 85 indirect) bytes in 3 blocks are definitely lost in loss record 25 of 26 ==22890== at 0x1B8FF8A6: malloc (in /usr/lib/valgrind/vgpreload_memcheck.so) ==22890== by 0x1BB8E45A: g_malloc (in /opt/gnome/lib/libglib-2.0.so.0.800.1) ==22890== by 0x1C36E28D: gst_rmdemux_chain (rmdemux.c:1733) ==22890== by 0x1C36F9D1: gst_rmdemux_loop (rmdemux.c:827) ==22890== by 0x1B953C7E: gst_task_func (gsttask.c:192) ==22890== by 0x1BBA7A54: (within /opt/gnome/lib/libglib-2.0.so.0.800.1) ==22890== by 0x1BBA5B60: (within /opt/gnome/lib/libglib-2.0.so.0.800.1) ==22890== by 0x1B9EA296: start_thread (in /lib/tls/libpthread-2.3.5.so) ==22890== by 0x1BCA637D: clone (in /lib/tls/libc-2.3.5.so) ==22890== by 0x1C573BAF: ??? Expected results: Does this happen every time? Other information: Patch attached below.
Created attachment 78253 [details] [review] Corrective patch
Thanks, looks good, will commit after freeze.
Committed, thanks for the patch. 2006-12-14 Tim-Philipp Müller <tim at centricular dot net> Patch by: Roland Kay <roland.kay at ox compsoc net> * gst/realmedia/rmdemux.c: (gst_rmdemux_reset): Don't leak stream index (#385292).