From 826965326c93ecf81e3188cc88be3722f27355c7 Mon Sep 17 00:00:00 2001 From: rtogni Date: Wed, 30 Aug 2006 20:18:27 +0000 Subject: 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 --- stream/librtsp/rtsp_session.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'stream') 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 */ -- cgit v1.2.3