GNOME Bugzilla – Bug 756799
auparse: fix event leak
Last modified: 2015-10-19 09:38:18 UTC
Events are supposed to be either passed on or handled and freed. This is not being done in auparse resulting in leaks ==3074== 364 (16 direct, 348 indirect) bytes in 1 blocks are definitely lost in loss record 4,780 of 4,911 ==3074== at 0x402C17C: malloc (in /usr/lib/valgrind/vgpreload_memcheck-x86-linux.so) ==3074== by 0x434CBE2: g_malloc (in /lib/i386-linux-gnu/libglib-2.0.so.0.4002.0) ==3074== by 0x4363281: g_slice_alloc (in /lib/i386-linux-gnu/libglib-2.0.so.0.4002.0) ==3074== by 0x41FD0A1: gst_structure_new_id_empty_with_size (gststructure.c:145) ==3074== by 0x41FF637: gst_structure_new_id (gststructure.c:750) ==3074== by 0x41C21EB: gst_event_new_seek (gstevent.c:1149) ==3074== by 0x804B511: play_do_seek (gst-play.c:816) ==3074== by 0x804B838: play_set_rate_and_trick_mode (gst-play.c:766) ==3074== by 0x804B855: play_set_playback_rate (gst-play.c:832) ==3074== by 0x804CB2F: gst_play_kb_io_cb (gst-play-kb.c:63) ==3074== by 0x438CDE4: ??? (in /lib/i386-linux-gnu/libglib-2.0.so.0.4002.0) ==3074== by 0x43470A6: g_main_context_dispatch (in /lib/i386-linux-gnu/libglib-2.0.so.0.4002.0)
Created attachment 313642 [details] [review] fix event leak
Or perhaps just unref in gst_au_parse_src_event() instead?
there are two cases here actually.. In case format is not time, we are just returning FALSE.. In this case probably we can check return value and free in src_event() But when format is time, we are just overwriting the event being passed and creating a new event. So at least one unref should be done in handle_seek()
That's just re-using the existing variable for convenience in handle_seek, it won't overwrite the variable in _src_event().
Created attachment 313645 [details] [review] fix event leak Yes you are right!! my mistake :)
Thanks. commit 0cefb6722bb8f4f67e8fe7cd0bd3fe7cfd57e63e Author: Vineeth TM <vineeth.tm@samsung.com> Date: Mon Oct 19 17:38:32 2015 +0900 auparse: Fix event memory leak Free the event after being handled to prevent memory leak. https://bugzilla.gnome.org/show_bug.cgi?id=756799