aboutsummaryrefslogtreecommitdiffhomepage
path: root/stream
diff options
context:
space:
mode:
authorGravatar rtogni <rtogni@b3059339-0415-0410-9bf9-f77b7e298cf2>2006-08-30 20:18:27 +0000
committerGravatar rtogni <rtogni@b3059339-0415-0410-9bf9-f77b7e298cf2>2006-08-30 20:18:27 +0000
commit826965326c93ecf81e3188cc88be3722f27355c7 (patch)
treea1144804d6dac7a15d69a83cecd6446cbe9c026e /stream
parentd0d900423c6eb3e297f510e08205b7f59598e376 (diff)
Avoid a potential strdup(NULL)
Fix sig11 with rtsp://wms.stream.aol.com/aol/us/moviefone/movies/2006/jesuscamp_027214/prestigethe_trlr_01_460.wmv git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@19601 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'stream')
-rw-r--r--stream/librtsp/rtsp_session.c6
1 files changed, 1 insertions, 5 deletions
diff --git a/stream/librtsp/rtsp_session.c b/stream/librtsp/rtsp_session.c
index 6a437ebec0..b222543f57 100644
--- a/stream/librtsp/rtsp_session.c
+++ b/stream/librtsp/rtsp_session.c
@@ -155,9 +155,7 @@ rtsp_session_t *rtsp_session_start(int fd, char **mrl, char *path, char *host, i
char *public = NULL;
/* look for the Public: field in response to RTSP OPTIONS */
- public = strdup (rtsp_search_answers (rtsp_session->s,
- RTSP_OPTIONS_PUBLIC));
- if (!public)
+ if (!(public = rtsp_search_answers (rtsp_session->s, RTSP_OPTIONS_PUBLIC)))
{
rtsp_close (rtsp_session->s);
free (server);
@@ -172,7 +170,6 @@ rtsp_session_t *rtsp_session_start(int fd, char **mrl, char *path, char *host, i
|| !strstr (public, RTSP_METHOD_PLAY)
|| !strstr (public, RTSP_METHOD_TEARDOWN))
{
- free (public);
mp_msg (MSGT_OPEN, MSGL_ERR,
"Remote server does not meet minimal RTSP 1.0 compliance.\n");
rtsp_close (rtsp_session->s);
@@ -182,7 +179,6 @@ rtsp_session_t *rtsp_session_start(int fd, char **mrl, char *path, char *host, i
return NULL;
}
- free (public);
rtsp_session->rtp_session = rtp_setup_and_play (rtsp_session->s);
/* neither a Real or an RTP server */