From 26263c194e8a5cda608e40319ae58501baeda19f Mon Sep 17 00:00:00 2001 From: Ludvig Rappe Date: Thu, 28 Apr 2022 17:08:11 +0200 Subject: [PATCH] webrtc: Fix memory leak in icestream Since both g_value_set_object() and g_weak_ref_get() takes a reference there will be two new references to the GstWebRTCICE object when there should be only one. g_value_take_object() has the same functionality as g_value_set_object() but does not take a reference. Without this change, the GstWebRTCICE object will be leaked. Part-of: --- subprojects/gst-plugins-bad/ext/webrtc/icestream.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/subprojects/gst-plugins-bad/ext/webrtc/icestream.c b/subprojects/gst-plugins-bad/ext/webrtc/icestream.c index 741ec8078e..8b85ec9035 100644 --- a/subprojects/gst-plugins-bad/ext/webrtc/icestream.c +++ b/subprojects/gst-plugins-bad/ext/webrtc/icestream.c @@ -83,7 +83,7 @@ gst_webrtc_ice_stream_get_property (GObject * object, guint prop_id, switch (prop_id) { case PROP_ICE: - g_value_set_object (value, g_weak_ref_get (&stream->ice_weak)); + g_value_take_object (value, g_weak_ref_get (&stream->ice_weak)); break; case PROP_STREAM_ID: g_value_set_uint (value, stream->stream_id);