[0.11] gstreamer: gstinspect: fix features and list leaks

Tim Müller tpm at kemper.freedesktop.org
Thu Jan 12 16:23:49 PST 2012


Module: gstreamer
Branch: 0.11
Commit: f460cea1d71fe60b7cf7803ae134e33253d9299a
URL:    http://cgit.freedesktop.org/gstreamer/gstreamer/commit/?id=f460cea1d71fe60b7cf7803ae134e33253d9299a

Author: Vincent Penquerc'h <vincent.penquerch at collabora.co.uk>
Date:   Thu Jan 12 15:50:53 2012 +0000

gstinspect: fix features and list leaks

---

 tools/gst-inspect.c |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/tools/gst-inspect.c b/tools/gst-inspect.c
index d3ce0c8..165ad3f 100644
--- a/tools/gst-inspect.c
+++ b/tools/gst-inspect.c
@@ -1230,7 +1230,7 @@ print_plugin_info (GstPlugin * plugin)
 static void
 print_plugin_features (GstPlugin * plugin)
 {
-  GList *features;
+  GList *features, *features_to_free;
   gint num_features = 0;
   gint num_elements = 0;
   gint num_typefinders = 0;
@@ -1241,6 +1241,7 @@ print_plugin_features (GstPlugin * plugin)
       gst_registry_get_feature_list_by_plugin (gst_registry_get_default (),
       plugin->desc.name);
 
+  features_to_free = features;
   while (features) {
     GstPluginFeature *feature;
 
@@ -1284,6 +1285,7 @@ print_plugin_features (GstPlugin * plugin)
       num_other++;
     }
     num_features++;
+    gst_object_unref (feature);
     features = g_list_next (features);
   }
   n_print ("\n");
@@ -1298,6 +1300,9 @@ print_plugin_features (GstPlugin * plugin)
     n_print ("  +-- %d other objects\n", num_other);
 
   n_print ("\n");
+
+  if (features_to_free)
+    g_list_free (features_to_free);
 }
 
 static int



More information about the gstreamer-commits mailing list