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 539292 - memory leak in mpegtsparse
memory leak in mpegtsparse
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-bad
git master
Other Linux
: Normal normal
: 0.10.8
Assigned To: GStreamer Maintainers
GStreamer Maintainers
: 541087 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2008-06-20 14:32 UTC by Vincent Génieux
Modified: 2008-07-07 13:24 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
proposed patch. (3.05 KB, patch)
2008-06-20 14:36 UTC, Vincent Génieux
rejected Details | Review
fix (3.24 KB, patch)
2008-07-01 21:59 UTC, Alessandro Decina
none Details | Review

Description Vincent Génieux 2008-06-20 14:32:19 UTC
There is a memory leak while posting new table in message bus.

Valgrind trace :

==12848== 
==12848== 7,469,553 (20,720 direct, 7,448,833 indirect) bytes in 1,035 blocks are definitely lost in loss record 25 of 28
==12848==    at 0x4021AA4: calloc (vg_replace_malloc.c:279)
==12848==    by 0x415CA5D: g_malloc0 (in /usr/lib/libglib-2.0.so.0.1400.1)
==12848==    by 0x408613A: gst_structure_id_empty_new_with_size (gststructure.c:116)
==12848==    by 0x4086735: gst_structure_new_valist (gststructure.c:238)
==12848==    by 0x40867B1: gst_structure_new (gststructure.c:209)
==12848==    by 0x474B526: mpegts_packetizer_parse_eit (mpegtspacketizer.c:1344)
==12848==    by 0x474A3EE: mpegts_parse_chain (mpegtsparse.c:1153)
==12848==    by 0x4072698: gst_pad_chain_unchecked (gstpad.c:3503)
==12848==    by 0x4072D51: gst_pad_push (gstpad.c:3671)
==12848==    by 0x4733557: gst_queue_loop (gstqueue.c:991)
==12848==    by 0x408C895: gst_task_func (gsttask.c:192)
==12848==    by 0x417A0C7: (within /usr/lib/libglib-2.0.so.0.1400.1)
==12848==
Comment 1 Vincent Génieux 2008-06-20 14:36:27 UTC
Created attachment 113119 [details] [review]
proposed patch.

There is a copy of gst_structure which is never used and never released. The patch removes this useless copy...
Comment 2 Alessandro Decina 2008-06-21 08:57:57 UTC
The copy is necessary as gst_message_new_element takes the ownership of the structure. Some structures are still used after they are posted on the bus, see mpegts_parse_apply_pat for example. 
For consistency, I would unref the structures in mpegts_parse_handle_psi. 
Comment 3 Vincent Génieux 2008-07-01 14:33:22 UTC
There is no ref/unref on gst_structures. Anyway I let you improve the patch in a better way.
Comment 4 Alessandro Decina 2008-07-01 21:25:38 UTC
You're right, I meant that they have to be free'd in mpegts_parse_handle_psi.
Comment 5 Michael Smith 2008-07-01 21:44:14 UTC
*** Bug 541087 has been marked as a duplicate of this bug. ***
Comment 6 Alessandro Decina 2008-07-01 21:59:38 UTC
Created attachment 113814 [details] [review]
fix
Comment 7 Zaheer Abbas Merali 2008-07-07 13:24:43 UTC
Thanks, patch committed.