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/6807>
This commit is contained in:
Matthew Waters 2024-05-06 20:50:21 +10:00 committed by GStreamer Marge Bot
parent 6fd1900d54
commit c9af1d486a

View file

@ -7513,7 +7513,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,