webrtcbin: Avoid access of freed memory

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2256>
This commit is contained in:
Sangchul Lee 2022-04-21 00:38:37 +09:00 committed by GStreamer Marge Bot
parent 27dea62304
commit c5b1eecb69

View file

@ -1886,7 +1886,6 @@ _find_codec_preferences (GstWebRTCBin * webrtc,
caps = _query_pad_caps (webrtc, rtp_trans, pad, filter, error);
}
gst_object_unref (pad);
if (*error)
goto out;
@ -1940,6 +1939,8 @@ _find_codec_preferences (GstWebRTCBin * webrtc,
out:
if (pad)
gst_object_unref (pad);
if (codec_preferences)
gst_caps_unref (codec_preferences);