webrtc/datachannel: clear the error after use

Fixes a memory leak

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1535>
This commit is contained in:
Matthew Waters 2020-08-24 17:01:59 +10:00
parent 7489addc0a
commit e15a8fcbdd

View file

@ -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));
}