From 72f76c26cfaf38809f3f4e068fb7d2e4948c516e Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Wed, 7 Jun 2006 08:38:30 +0000 Subject: [PATCH] Fix leak spotted by coverity checker. Fixes #343827 Original commit message from CVS: * gst/gstindex.c: (gst_index_gtype_resolver): * tools/gst-xmlinspect.c: (print_plugin_info): Fix leak spotted by coverity checker. Fixes #343827 Fix another other leak found by paolo borelli. --- ChangeLog | 7 +++++++ gst/gstindex.c | 8 +++++++- tools/gst-xmlinspect.c | 2 +- 3 files changed, 15 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 13ecc05..ea48a17 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2006-06-07 Wim Taymans + + * gst/gstindex.c: (gst_index_gtype_resolver): + * tools/gst-xmlinspect.c: (print_plugin_info): + Fix leak spotted by coverity checker. Fixes #343827 + Fix another other leak found by paolo borelli. + 2006-06-06 Thomas Vander Stichele * libs/gst/dataprotocol/dataprotocol.c: diff --git a/gst/gstindex.c b/gst/gstindex.c index 821be16..a7681b5 100644 --- a/gst/gstindex.c +++ b/gst/gstindex.c @@ -557,9 +557,15 @@ gst_index_gtype_resolver (GstIndex * index, GstObject * writer, if (GST_IS_PAD (writer)) { GstElement *element = (GstElement *) gst_object_get_parent (GST_OBJECT (writer)); + gchar *name; + name = gst_object_get_name (writer); *writer_string = g_strdup_printf ("%s.%s", - g_type_name (G_OBJECT_TYPE (element)), gst_object_get_name (writer)); + g_type_name (G_OBJECT_TYPE (element)), name); + + gst_object_unref (element); + g_free (name); + } else { *writer_string = g_strdup_printf ("%s", g_type_name (G_OBJECT_TYPE (writer))); diff --git a/tools/gst-xmlinspect.c b/tools/gst-xmlinspect.c index 0c018ff..d6cf475 100644 --- a/tools/gst-xmlinspect.c +++ b/tools/gst-xmlinspect.c @@ -733,7 +733,7 @@ print_plugin_info (GstPlugin * plugin) g_print ("%s type: N/A\n", plugin->desc.name); num_types++; } else { - g_print (" %s (%s)\n", gst_object_get_name (GST_OBJECT (feature)), + g_print (" %s (%s)\n", GST_OBJECT_NAME (feature), g_type_name (G_OBJECT_TYPE (feature))); num_other++; } -- 2.7.4