]> git.sesse.net Git - vlc/blobdiff - modules/demux/live555.cpp
Fix double free in live555.
[vlc] / modules / demux / live555.cpp
index 6eaea80689130fc201b31921b1c77d470cb86cf0..6fc5f776f10d7830f66a0dcbb5ebddc23a4923f8 100644 (file)
@@ -478,6 +478,7 @@ createnew:
         psz_pwd  = var_CreateGetString( p_demux, "rtsp-pwd" );
     }
 
+describe:
     authenticator.setUsernameAndPassword( (const char*)psz_user,
                                           (const char*)psz_pwd );
 
@@ -485,7 +486,6 @@ createnew:
                                                &authenticator );
     if( psz_options ) delete [] psz_options;
 
-describe:
     p_sdp = p_sys->rtsp->describeURL( psz_url,
                 &authenticator, var_CreateGetBool( p_demux, "rtsp-kasenna" ) );
 
@@ -499,7 +499,9 @@ describe:
         const char *psz_error = p_sys->env->getResultMsg();
 
         msg_Dbg( p_demux, "DESCRIBE failed with %d: %s", i_code, psz_error );
-        sscanf( psz_error, "%*sRTSP/%*s%3u", &i_code );
+        if( var_CreateGetBool( p_demux, "rtsp-http" ) )
+            sscanf( psz_error, "%*s %*s HTTP GET %*s HTTP/%*u.%*u %3u %*s", &i_code );
+        else sscanf( psz_error, "%*sRTSP/%*s%3u", &i_code );
 
         if( i_code == 401 )
         {
@@ -513,7 +515,6 @@ describe:
             {
                msg_Dbg( p_demux, "retrying with user=%s, pwd=%s",
                            psz_login, psz_password );
-               if( psz_url ) free( psz_url );
                if( psz_login ) psz_user = psz_login;
                if( psz_password ) psz_pwd = psz_password;
                goto describe;