From 329fe7f3774d05a752afedd53a7c2ec2e9797594 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Olivier=20Cr=C3=AAte?= Date: Thu, 30 Sep 2010 17:48:35 -0400 Subject: [PATCH] tests: Fix caps leak in the valve test --- tests/check/elements/valve.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/tests/check/elements/valve.c b/tests/check/elements/valve.c index 6c875c089a..609bf76211 100644 --- a/tests/check/elements/valve.c +++ b/tests/check/elements/valve.c @@ -82,8 +82,9 @@ GST_START_TEST (test_valve_basic) fail_unless (gst_pad_push_event (src, gst_event_new_eos ()) == TRUE); fail_unless (event_received == TRUE); - fail_unless (gst_pad_alloc_buffer (src, 0, 10, gst_caps_new_any (), &buf) == - GST_FLOW_OK); + caps = gst_caps_new_any (); + fail_unless (gst_pad_alloc_buffer (src, 0, 10, caps, &buf) == GST_FLOW_OK); + gst_caps_unref (caps); fail_unless (buffer_allocated == TRUE); gst_buffer_unref (buf); fail_unless (gst_pad_push (src, gst_buffer_new ()) == GST_FLOW_OK); @@ -100,8 +101,9 @@ GST_START_TEST (test_valve_basic) g_object_set (valve, "drop", TRUE, NULL); fail_unless (gst_pad_push_event (src, gst_event_new_eos ()) == TRUE); fail_unless (event_received == FALSE); - fail_unless (gst_pad_alloc_buffer (src, 0, 10, gst_caps_new_any (), &buf) == - GST_FLOW_OK); + caps = gst_caps_new_any (); + fail_unless (gst_pad_alloc_buffer (src, 0, 10, caps, &buf) == GST_FLOW_OK); + gst_caps_unref (caps); fail_unless (buffer_allocated == FALSE); gst_buffer_unref (buf); fail_unless (gst_pad_push (src, gst_buffer_new ()) == GST_FLOW_OK); -- 2.34.1