diff options
author | Wim Taymans <wim.taymans@collabora.co.uk> | 2010-02-01 16:46:36 +0100 |
---|---|---|
committer | Wim Taymans <wim@metal.(none)> | 2010-02-01 19:32:11 +0100 |
commit | c35a9848014559ec13d7dbe6af41d216367039b9 (patch) | |
tree | 3e40a357a8f3162773a0b10933c3cefb2891dba8 | |
parent | 5290b514c8279575a7b05ab58a2577a62737b5fb (diff) |
rtspsrc: free transports on errors
See #608564
-rw-r--r-- | gst/rtsp/gstrtspsrc.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/gst/rtsp/gstrtspsrc.c b/gst/rtsp/gstrtspsrc.c index 4b4a908d8..7ab3e3e4d 100644 --- a/gst/rtsp/gstrtspsrc.c +++ b/gst/rtsp/gstrtspsrc.c @@ -4329,12 +4329,14 @@ gst_rtspsrc_setup_streams (GstRTSPSrc * src) GST_DEBUG_OBJECT (src, "protocols = 0x%x, protocol mask = 0x%x", protocols, protocol_masks[mask]); /* create a string with first transport in line */ + transports = NULL; res = gst_rtspsrc_create_transports_string (src, protocols & protocol_masks[mask], &transports); if (res < 0 || transports == NULL) goto setup_transport_failed; if (strlen (transports) == 0) { + g_free (transports); GST_DEBUG_OBJECT (src, "no transports found"); mask++; goto next_protocol; @@ -4346,8 +4348,10 @@ gst_rtspsrc_setup_streams (GstRTSPSrc * src) * allocate UDP ports and other info needed to execute the setup request */ res = gst_rtspsrc_prepare_transports (stream, &transports, retry > 0 ? rtpport : 0, retry > 0 ? rtcpport : 0); - if (res < 0) + if (res < 0) { + g_free (transports); goto setup_transport_failed; + } GST_DEBUG_OBJECT (src, "transport is now %s", GST_STR_NULL (transports)); @@ -4355,8 +4359,10 @@ gst_rtspsrc_setup_streams (GstRTSPSrc * src) res = gst_rtsp_message_init_request (&request, GST_RTSP_SETUP, stream->setup_url); - if (res < 0) + if (res < 0) { + g_free (transports); goto create_request_failed; + } /* select transport, copy is made when adding to header so we can free it. */ gst_rtsp_message_add_header (&request, GST_RTSP_HDR_TRANSPORT, transports); |