]> git.sesse.net Git - vlc/commitdiff
rtp sout: fix another race condition in RTSP
authorPierre Ynard <linkfanel@yahoo.fr>
Thu, 28 Jan 2010 00:59:43 +0000 (01:59 +0100)
committerPierre Ynard <linkfanel@yahoo.fr>
Thu, 28 Jan 2010 00:59:43 +0000 (01:59 +0100)
When RTSP is shut down, the server destroys sessions (with no locking)
while clients are still able to concurrently access them, potentially
leading to a crash. Make sure we unregister the RTSP URL before
cleaning up (then indeed no locking is needed).

modules/stream_out/rtsp.c

index 1f58f75e0edf74ed488fc81a8fbe1ff6264fa454..0d103fa6d2960be6ca6ca461d15e3b66f8a381d2 100644 (file)
@@ -122,12 +122,12 @@ error:
 
 void RtspUnsetup( rtsp_stream_t *rtsp )
 {
-    while( rtsp->sessionc > 0 )
-        RtspClientDel( rtsp, rtsp->sessionv[0] );
-
     if( rtsp->url )
         httpd_UrlDelete( rtsp->url );
 
+    while( rtsp->sessionc > 0 )
+        RtspClientDel( rtsp, rtsp->sessionv[0] );
+
     if( rtsp->host )
         httpd_HostDelete( rtsp->host );