From cc9fe814d617d6ef2b46f7407515fda8ec37ba29 Mon Sep 17 00:00:00 2001 From: Mathieu Duponchelle Date: Fri, 13 Apr 2018 17:37:47 +0200 Subject: [PATCH] rtpulpfec tests: Fix leaks --- tests/check/elements/rtpulpfec.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/tests/check/elements/rtpulpfec.c b/tests/check/elements/rtpulpfec.c index f172233ba9..13ac19be73 100644 --- a/tests/check/elements/rtpulpfec.c +++ b/tests/check/elements/rtpulpfec.c @@ -111,8 +111,11 @@ static void push_data (GstHarness * h, gconstpointer rtp, gsize rtp_length) { GstBuffer *buf = gst_rtp_buffer_new_copy_data (rtp, rtp_length); + GstBuffer *bufout; - gst_harness_push_and_pull (h, buf); + bufout = gst_harness_push_and_pull (h, buf); + if (bufout) + gst_buffer_unref (bufout); } static GstHarness * @@ -556,6 +559,7 @@ GST_START_TEST (rtpulpfecdec_invalid_recovered_pt_mismatch) GstHarness *h = harness_rtpulpfecdec (3536077562, 100, 123); GstRTPBuffer rtp = GST_RTP_BUFFER_INIT; GstBuffer *modified; + GstBuffer *bufout; gst_harness_set_src_caps_str (h, "application/x-rtp,ssrc=(uint)3536077562"); @@ -579,7 +583,9 @@ GST_START_TEST (rtpulpfecdec_invalid_recovered_pt_mismatch) gst_rtp_buffer_set_seq (&rtp, 36920); gst_rtp_buffer_unmap (&rtp); /* Now we have media packet with pt=50 and caps with pt=50. */ - gst_harness_push_and_pull (h, modified); + bufout = gst_harness_push_and_pull (h, modified); + if (bufout) + gst_buffer_unref (bufout); push_lost_event (h, 36921, 1111, 2222, TRUE); check_rtpulpfecdec_stats (h, 0, 3); @@ -600,6 +606,8 @@ GST_START_TEST (rtpulpfecdec_fecstorage_gives_no_buffers) push_lost_event (h, 36921, 1111, 2222, TRUE); check_rtpulpfecdec_stats (h, 0, 1); + + gst_harness_teardown (h); } GST_END_TEST;