webrtc: request-aux-sender, only sink floating refs

Don't add an extra ref if non-floating as that ref will never be
unreffed.

gst_bin_add() is transfer floating (alias to transfer none).

Fixes a leak when a non-floating ref was provided as a return value in
the request-aux-sender signal.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6809>
This commit is contained in:
Matthew Waters 2024-05-06 20:50:21 +10:00 committed by Backport Bot
parent e933c7a7e3
commit 7bebb24880

View file

@ -7504,7 +7504,8 @@ on_rtpbin_request_aux_sender (GstElement * rtpbin, guint session_id,
GstPad *sinkpad = gst_element_get_static_pad (aux_sender, "sink");
GstPad *srcpad = gst_element_get_static_pad (aux_sender, "src");
gst_object_ref_sink (aux_sender);
if (g_object_is_floating (aux_sender))
aux_sender = gst_object_ref_sink (aux_sender);
if (!sinkpad || !srcpad) {
GST_ERROR_OBJECT (webrtc,