From e15a8fcbdd1f6e84cac603de345f19d01c8207e8 Mon Sep 17 00:00:00 2001 From: Matthew Waters Date: Mon, 24 Aug 2020 17:01:59 +1000 Subject: [PATCH] webrtc/datachannel: clear the error after use Fixes a memory leak Part-of: --- ext/webrtc/webrtcdatachannel.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ext/webrtc/webrtcdatachannel.c b/ext/webrtc/webrtcdatachannel.c index 4305707254..fde12613c8 100644 --- a/ext/webrtc/webrtcdatachannel.c +++ b/ext/webrtc/webrtcdatachannel.c @@ -285,8 +285,10 @@ _transport_closed (WebRTCDataChannel * channel) channel->stored_error = NULL; GST_WEBRTC_DATA_CHANNEL_UNLOCK (channel); - if (error) + if (error) { gst_webrtc_data_channel_on_error (GST_WEBRTC_DATA_CHANNEL (channel), error); + g_clear_error (&error); + } gst_webrtc_data_channel_on_close (GST_WEBRTC_DATA_CHANNEL (channel)); }