From e4b848e2a8d3384e86e6717d5ac13eaf0d3551f1 Mon Sep 17 00:00:00 2001 From: Matthew Waters Date: Mon, 24 Aug 2020 17:00:30 +1000 Subject: [PATCH] tests/webrtc: unref GBytes after use Part-of: --- tests/check/elements/webrtcbin.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tests/check/elements/webrtcbin.c b/tests/check/elements/webrtcbin.c index 27da1d5..3b79bed 100644 --- a/tests/check/elements/webrtcbin.c +++ b/tests/check/elements/webrtcbin.c @@ -1739,6 +1739,7 @@ have_data_channel_transfer_data (struct test_webrtc *t, GstElement * element, g_signal_connect (other, "on-error", G_CALLBACK (on_channel_error_not_reached), NULL); g_signal_emit_by_name (other, "send-data", data); + g_bytes_unref (data); } GST_START_TEST (test_data_channel_transfer_data) @@ -1906,7 +1907,8 @@ have_data_channel_transfer_large_data (struct test_webrtc *t, for (i = 0; i < size; i++) random_data[i] = (guint8) (i & 0xff); - data = g_bytes_new_static (random_data, size); + data = g_bytes_new_with_free_func (random_data, size, + (GDestroyNotify) g_free, random_data); g_object_set_data_full (our, "expected", g_bytes_ref (data), (GDestroyNotify) g_bytes_unref); @@ -1914,6 +1916,7 @@ have_data_channel_transfer_large_data (struct test_webrtc *t, g_signal_connect (other, "on-error", G_CALLBACK (on_channel_error), t); g_signal_emit_by_name (other, "send-data", data); + g_bytes_unref (data); } GST_START_TEST (test_data_channel_max_message_size) -- 2.7.4