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 754973 - xvimagesink: fix error leak when context creation fails
xvimagesink: fix error leak when context creation fails
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-base
git master
Other Linux
: Normal normal
: 1.5.91
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2015-09-14 00:36 UTC by Vineeth
Modified: 2015-09-14 16:27 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
fix error leak (975 bytes, patch)
2015-09-14 00:37 UTC, Vineeth
committed Details | Review

Description Vineeth 2015-09-14 00:36:13 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)
Comment 1 Vineeth 2015-09-14 00:37:08 UTC
Created attachment 311245 [details] [review]
fix error leak
Comment 2 Tim-Philipp Müller 2015-09-14 16:27:29 UTC
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