mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-13 12:51:16 +00:00
rtspclientsink: make sure not to use freed string
Set transport string to NULL after freeing it, so that at worst we get a NULL pointer if constructing a new transport string fails (which shouldn't really fail here). Also check return value of that, just in case. CID 1433768.
This commit is contained in:
parent
c36d6b477c
commit
e3bbd40f0e
1 changed files with 4 additions and 0 deletions
|
@ -3966,9 +3966,13 @@ gst_rtsp_client_sink_setup_streams (GstRTSPClientSink * sink, gboolean async)
|
|||
* the request headers instead of the previous, incomplete one.
|
||||
*/
|
||||
g_free (transports);
|
||||
transports = NULL;
|
||||
res = gst_rtsp_client_sink_create_transports_string (sink, context, family,
|
||||
protocols & protocol_masks[mask], cur_profile, &transports);
|
||||
|
||||
if (res < 0 || transports == NULL)
|
||||
goto setup_transport_failed;
|
||||
|
||||
/* select transport */
|
||||
gst_rtsp_message_take_header (&request, GST_RTSP_HDR_TRANSPORT, transports);
|
||||
|
||||
|
|
Loading…
Reference in a new issue