Commit b6be3ac9 authored by Tim-Philipp Müller's avatar Tim-Philipp Müller 🐠 Committed by Sebastian Dröge

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.
parent 3244a351
......@@ -3962,9 +3962,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);
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment