From 2253f8fa6fc82434871408008eb4d3cef019a6bb Mon Sep 17 00:00:00 2001 From: =?utf8?q?Sebastian=20Dr=C3=B6ge?= Date: Wed, 29 May 2013 11:36:38 +0200 Subject: [PATCH] pad: Fix memory leak in the unit test --- tests/check/gst/gstpad.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tests/check/gst/gstpad.c b/tests/check/gst/gstpad.c index e55ffbc..406d1ce 100644 --- a/tests/check/gst/gstpad.c +++ b/tests/check/gst/gstpad.c @@ -232,8 +232,10 @@ sticky_event (GstPad * pad, GstObject * parent, GstEvent * event) || GST_EVENT_TYPE (event) == GST_EVENT_STREAM_START || GST_EVENT_TYPE (event) == GST_EVENT_SEGMENT); - if (GST_EVENT_TYPE (event) != GST_EVENT_CAPS) + if (GST_EVENT_TYPE (event) != GST_EVENT_CAPS) { + gst_event_unref (event); return TRUE; + } /* Ensure we get here just once: */ fail_unless (event_caps == NULL); @@ -304,7 +306,6 @@ GST_START_TEST (test_sticky_caps_unlinked) gst_caps_replace (&caps, NULL); gst_caps_replace (&event_caps, NULL); - ASSERT_OBJECT_REFCOUNT (src, "src", 1); ASSERT_OBJECT_REFCOUNT (sink, "sink", 1); gst_object_unref (src); -- 2.7.4