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 700903 - tsdemux: possible descriptor string leak
tsdemux: possible descriptor string leak
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-bad
1.0.7
Other Windows
: Normal normal
: 1.1.1
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2013-05-23 15:23 UTC by Michael Rubinstein
Modified: 2013-05-25 16:42 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Michael Rubinstein 2013-05-23 15:23:06 UTC
In the function mpegts_get_descriptor_from_stream() in:
 gst-plugins-bad\gst\mpegtsdemux\mpegtsbase.c 
is the following code:

  for (i = 0; i < descriptors->n_values; i++) {
    GValue *value = g_value_array_get_nth (descriptors, i);
    GString *desc = g_value_dup_boxed (value);
    if (DESC_TAG (desc->str) == tag) {
      retval = (guint8 *) desc->str;
      g_string_free (desc, FALSE);
      break;
    } else
      g_string_free (desc, FALSE);      // <<< should be TRUE?
  }

If we find the matching tag, we want to keep desc->str, but free desc.
If we don't match, we want to delete both, I think.

Changing to "TRUE" fixed a memory leak for me.
Comment 1 Sebastian Dröge (slomo) 2013-05-25 13:27:21 UTC
commit ee3a7566c601be098266b54eb4d3c8a48fe56872
Author: Michael Rubinstein <mrubinstein@weather.com>
Date:   Sat May 25 15:25:56 2013 +0200

    mpegtsdemux: Free memory behind GString if we don't use it
    
    https://bugzilla.gnome.org/show_bug.cgi?id=700903