webrtcdatachannel: Bind to parent webrtcbin using a weak reference
authorPhilippe Normand <philn@igalia.com>
Sun, 12 Mar 2023 14:55:22 +0000 (14:55 +0000)
committerTim-Philipp Müller <tim@centricular.com>
Tue, 9 May 2023 07:54:52 +0000 (08:54 +0100)
commit268ce06c78571afdaf95671c9a455f24f469bf4b
tree67b8fb48799d59c0d17eb77c1846398e78978f70
parent0161687505156f54ff38b976668804ac2763a863
webrtcdatachannel: Bind to parent webrtcbin using a weak reference

The previous approach of using a simple pointer could lead to a use-after-free
in case a data-channel was created and its parent webrtcbin was disposed soon
after.

Fixes #2103

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4580>
subprojects/gst-plugins-bad/ext/webrtc/gstwebrtcbin.c
subprojects/gst-plugins-bad/ext/webrtc/webrtcdatachannel.c
subprojects/gst-plugins-bad/ext/webrtc/webrtcdatachannel.h