changeset 19595:c19e6c7487b1

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
author rtogni
date Wed, 30 Aug 2006 20:18:27 +0000
parents 4678e9f81334
children 9c679ff8e161
files stream/librtsp/rtsp_session.c
diffstat 1 files changed, 1 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/stream/librtsp/rtsp_session.c	Wed Aug 30 10:50:20 2006 +0000
+++ b/stream/librtsp/rtsp_session.c	Wed Aug 30 20:18:27 2006 +0000
@@ -155,9 +155,7 @@
     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 @@
         || !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 @@
       return NULL;
     }
 
-    free (public);
     rtsp_session->rtp_session = rtp_setup_and_play (rtsp_session->s);
 
     /* neither a Real or an RTP server */