mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-26 03:31:05 +00:00
webrtc: patch leak caused by early return
In webrtc_data_channel_send functions, both data and string, an early return on a non-open datachannel caused it to leak the buffer used for pushing to appsrc, meaning any buffer sent after leaving the open state was leaked in full. Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4191>
This commit is contained in:
parent
e9faf63d2e
commit
65bd020754
1 changed files with 2 additions and 0 deletions
|
@ -871,6 +871,7 @@ webrtc_data_channel_send_data (GstWebRTCDataChannel * base_channel,
|
||||||
GST_WEBRTC_DATA_CHANNEL_UNLOCK (channel);
|
GST_WEBRTC_DATA_CHANNEL_UNLOCK (channel);
|
||||||
g_set_error (error, GST_WEBRTC_ERROR,
|
g_set_error (error, GST_WEBRTC_ERROR,
|
||||||
GST_WEBRTC_ERROR_INVALID_STATE, "channel is not open");
|
GST_WEBRTC_ERROR_INVALID_STATE, "channel is not open");
|
||||||
|
gst_buffer_unref (buffer);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
GST_WEBRTC_DATA_CHANNEL_UNLOCK (channel);
|
GST_WEBRTC_DATA_CHANNEL_UNLOCK (channel);
|
||||||
|
@ -945,6 +946,7 @@ webrtc_data_channel_send_string (GstWebRTCDataChannel * base_channel,
|
||||||
GST_WEBRTC_DATA_CHANNEL_UNLOCK (channel);
|
GST_WEBRTC_DATA_CHANNEL_UNLOCK (channel);
|
||||||
g_set_error (error, GST_WEBRTC_ERROR,
|
g_set_error (error, GST_WEBRTC_ERROR,
|
||||||
GST_WEBRTC_ERROR_INVALID_STATE, "channel is not open");
|
GST_WEBRTC_ERROR_INVALID_STATE, "channel is not open");
|
||||||
|
gst_buffer_unref (buffer);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
GST_WEBRTC_DATA_CHANNEL_UNLOCK (channel);
|
GST_WEBRTC_DATA_CHANNEL_UNLOCK (channel);
|
||||||
|
|
Loading…
Reference in a new issue