[Bug 755326] New: souphttpclientsink: Fix memory leaks and segfault crash.

GStreamer (GNOME Bugzilla) bugzilla at gnome.org
Sun Sep 20 23:04:50 PDT 2015


https://bugzilla.gnome.org/show_bug.cgi?id=755326

            Bug ID: 755326
           Summary: souphttpclientsink: Fix memory leaks and segfault
                    crash.
    Classification: Platform
           Product: GStreamer
           Version: git master
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: Normal
         Component: gst-plugins-good
          Assignee: gstreamer-bugs at lists.freedesktop.org
          Reporter: vineeth.tm at samsung.com
        QA Contact: gstreamer-bugs at lists.freedesktop.org
     GNOME version: ---

This bug covers 2 memory leaks, 1 segfault issue and improvement in removing
redundant function.

1) Memory leaks.
When launching the sample pipeline present in the file, which has a invalid
http uri, there are 2 memory leaks.

==17141== 24 (12 direct, 12 indirect) bytes in 1 blocks are definitely lost in
loss record 2,337 of 3,970
==17141==    at 0x402C17C: malloc (in
/usr/lib/valgrind/vgpreload_memcheck-x86-linux.so)
==17141==    by 0x4212BE2: g_malloc (in
/lib/i386-linux-gnu/libglib-2.0.so.0.4002.0)
==17141==    by 0x4229281: g_slice_alloc (in
/lib/i386-linux-gnu/libglib-2.0.so.0.4002.0)
==17141==    by 0x42093E0: g_list_append (in
/lib/i386-linux-gnu/libglib-2.0.so.0.4002.0)
==17141==    by 0x62E7E58: gst_soup_http_client_sink_set_caps
(gstsouphttpclientsink.c:463)
==17141==    by 0x6149906: gst_base_sink_default_event (gstbasesink.c:3137)
==17141==    by 0x62E7984: gst_soup_http_client_sink_event
(gstsouphttpclientsink.c:618)
==17141==    by 0x6141FB2: gst_base_sink_event (gstbasesink.c:3243)
==17141==    by 0x409E34C: gst_pad_send_event_unchecked (gstpad.c:5452)
==17141==    by 0x409EAD6: gst_pad_push_event_unchecked (gstpad.c:5123)
==17141==    by 0x409F127: push_sticky (gstpad.c:3690)
==17141==    by 0x409CEF6: events_foreach (gstpad.c:597)


==17141== 17,585 (24 direct, 17,561 indirect) bytes in 2 blocks are definitely
lost in loss record 3,968 of 3,970
==17141==    at 0x402C17C: malloc (in
/usr/lib/valgrind/vgpreload_memcheck-x86-linux.so)
==17141==    by 0x4212BE2: g_malloc (in
/lib/i386-linux-gnu/libglib-2.0.so.0.4002.0)
==17141==    by 0x4229281: g_slice_alloc (in
/lib/i386-linux-gnu/libglib-2.0.so.0.4002.0)
==17141==    by 0x42093E0: g_list_append (in
/lib/i386-linux-gnu/libglib-2.0.so.0.4002.0)
==17141==    by 0x62E76FF: gst_soup_http_client_sink_render
(gstsouphttpclientsink.c:793)
==17141==    by 0x6150D93: gst_base_sink_chain_unlocked.isra.12
(gstbasesink.c:3524)
==17141==    by 0x6152CB7: gst_base_sink_chain_main (gstbasesink.c:3647)
==17141==    by 0x409FC7D: gst_pad_push_data (gstpad.c:4085)
==17141==    by 0x6242439: gst_ogg_mux_push_buffer.isra.10 (gstoggmux.c:594)
==17141==    by 0x624611B: gst_ogg_mux_collected (gstoggmux.c:1618)
==17141==    by 0x616B618: gst_collect_pads_check_collected
(gstcollectpads.c:1364)
==17141==    by 0x616D12E: gst_collect_pads_chain (gstcollectpads.c:2217)


Adding code to free streamheader_buffers and sent_buffers in reset.


2) Segfault.
In case we pass a location without 'http://', then 
soup_message_new ("PUT", souphttpsink->location); will return NULL.
There is no check for this and results in segfault.
Hence checking the same and returning.


3) Redundant function.
A new function free_buffer_list is written, which does the same as
g_list_free_full. Hence removing the function and replacing it with
g_list_free_full in all places.


Adding all changes into a single patch for now.. 
Maybe we can split the patch for each change to avoid confusion.

-- 
You are receiving this mail because:
You are the QA Contact for the bug.
You are the assignee for the bug.


More information about the gstreamer-bugs mailing list