diff --git a/tests/check/elements/selector.c b/tests/check/elements/selector.c index b4fee5d614..0d43ff7e29 100644 --- a/tests/check/elements/selector.c +++ b/tests/check/elements/selector.c @@ -545,6 +545,7 @@ GST_START_TEST (test_output_selector_getcaps_active); for (walker = output_pads; walker; walker = g_list_next (walker)) { GstCaps *caps; GstPad *pad; + GstPadTemplate *templ; pad = gst_pad_get_peer ((GstPad *) walker->data); @@ -553,13 +554,14 @@ GST_START_TEST (test_output_selector_getcaps_active); /* in 'active' mode, the active srcpad peer's caps should be returned on * the sinkpad's getcaps */ - expected = gst_pad_template_get_caps (gst_pad_get_pad_template ((GstPad *) - walker->data)); + templ = gst_pad_get_pad_template ((GstPad *) walker->data); + expected = gst_pad_template_get_caps (templ); caps = gst_pad_peer_get_caps (input_pad, NULL); g_assert (gst_caps_is_equal (caps, expected)); gst_caps_unref (caps); gst_caps_unref (expected); + gst_object_unref (templ); gst_object_unref (pad); }