GNOME Bugzilla – Bug 754973
xvimagesink: fix error leak when context creation fails
Last modified: 2015-09-14 16:27:45 UTC
When context creation fails, the error message is being passed to gst_element_message_full which is transfer full, hence error->message will be freed. But the error variable itself is getting leaked. Hence duplicating the error->message before passing it on and freeing error variable on no_context. The leak is as below ==10417== 12 bytes in 1 blocks are definitely lost in loss record 586 of 1,750 ==10417== at 0x402C17C: malloc (in /usr/lib/valgrind/vgpreload_memcheck-x86-linux.so) ==10417== by 0x4212BE2: g_malloc (in /lib/i386-linux-gnu/libglib-2.0.so.0.4002.0) ==10417== by 0x4229281: g_slice_alloc (in /lib/i386-linux-gnu/libglib-2.0.so.0.4002.0) ==10417== by 0x41F8781: g_error_new_valist (in /lib/i386-linux-gnu/libglib-2.0.so.0.4002.0) ==10417== by 0x41F8AEC: g_set_error (in /lib/i386-linux-gnu/libglib-2.0.so.0.4002.0) ==10417== by 0x416A69D: gst_xvcontext_new (xvcontext.c:783) ==10417== by 0x416645D: gst_xv_image_sink_change_state (xvimagesink.c:1730) ==10417== by 0x4088DF2: gst_element_change_state (gstelement.c:2604) ==10417== by 0x40894FA: gst_element_set_state_func (gstelement.c:2560) ==10417== by 0x4088B3E: gst_element_set_state (gstelement.c:2461) ==10417== by 0x4065801: gst_bin_change_state_func (gstbin.c:2341) ==10417== by 0x40ACBB2: gst_pipeline_change_state (gstpipeline.c:499)
Created attachment 311245 [details] [review] fix error leak
commit dab39bf42bdabdf239747e3227a99caf3274be23 Author: Vineeth TM <vineeth.tm@samsung.com> Date: Mon Sep 14 09:36:20 2015 +0900 xvimagesink: fix error leak when context creation fails When context creation fails, error is getting leaked. https://bugzilla.gnome.org/show_bug.cgi?id=754973