From 149b17079e0224549bd0d9a2721498289a0ff8b5 Mon Sep 17 00:00:00 2001 From: David Schleef Date: Thu, 5 Feb 2004 02:44:34 +0000 Subject: [PATCH] Fix some memleaks: Original commit message from CVS: Fix some memleaks: * gst/autoplug/gstspider.c: (gst_spider_request_new_pad), (gst_spider_plug_from_srcpad): * gst/autoplug/gstspideridentity.c: (gst_spider_identity_link): --- ChangeLog | 7 +++++++ gst/autoplug/gstspider.c | 9 ++++++++- gst/autoplug/gstspideridentity.c | 2 +- 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index ea14e3f..3beb673 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,12 @@ 2004-02-04 David Schleef + Fix some memleaks: + * gst/autoplug/gstspider.c: (gst_spider_request_new_pad), + (gst_spider_plug_from_srcpad): + * gst/autoplug/gstspideridentity.c: (gst_spider_identity_link): + +2004-02-04 David Schleef + * gst/gstelement.c: (gst_element_clear_pad_caps): Make sure we have a GstRealPad before accessing its structure members. diff --git a/gst/autoplug/gstspider.c b/gst/autoplug/gstspider.c index b3f9c98..3b12efa 100644 --- a/gst/autoplug/gstspider.c +++ b/gst/autoplug/gstspider.c @@ -211,6 +211,7 @@ gst_spider_request_new_pad (GstElement *element, GstPadTemplate *templ, const gc gst_bin_add (GST_BIN (element), GST_ELEMENT (identity)); returnpad = gst_element_add_ghost_pad (element, returnpad, padname); + g_free (padname); gst_spider_link_new (identity); GST_DEBUG ("successuflly created requested pad %s:%s", GST_DEBUG_PAD_NAME (returnpad)); @@ -588,6 +589,8 @@ gst_spider_plug_from_srcpad (GstSpiderConnection *conn, GstPad *srcpad) gboolean result = TRUE; GstSpider *spider = (GstSpider *) GST_OBJECT_PARENT (conn->src); GstElement *startelement = conn->current; + GstCaps *caps1; + GstCaps *caps2; g_assert ((GstElement *) GST_OBJECT_PARENT (srcpad) == conn->current); GST_DEBUG ("trying to plug from %s:%s to %s", @@ -603,7 +606,11 @@ gst_spider_plug_from_srcpad (GstSpiderConnection *conn, GstPad *srcpad) } /* find a path from src to sink */ - plugpath = gst_autoplug_sp (gst_pad_get_caps (srcpad), gst_pad_get_caps (conn->src->sink), spider->factories); + caps1 = gst_pad_get_caps (srcpad); + caps2 = gst_pad_get_caps (conn->src->sink); + plugpath = gst_autoplug_sp (caps1, caps2, spider->factories); + gst_caps_free (caps1); + gst_caps_free (caps2); /* prints out the path that was found for plugging */ /* g_print ("found path from %s to %s:\n", GST_ELEMENT_NAME (conn->current), GST_ELEMENT_NAME (conn->src)); diff --git a/gst/autoplug/gstspideridentity.c b/gst/autoplug/gstspideridentity.c index 598eb76..e172bbd 100644 --- a/gst/autoplug/gstspideridentity.c +++ b/gst/autoplug/gstspideridentity.c @@ -236,7 +236,7 @@ gst_spider_identity_link (GstPad *pad, const GstCaps *caps) if (GST_PAD_PEER (otherpad) == NULL) return GST_PAD_LINK_DELAYED; - return gst_pad_try_set_caps (otherpad, gst_caps_copy (caps)); + return gst_pad_try_set_caps (otherpad, caps); } static GstCaps* -- 2.7.4