From 69ec164abb756871a3b7421493d28da1288a6bad Mon Sep 17 00:00:00 2001 From: Pierre Ynard Date: Thu, 28 Jan 2010 01:59:43 +0100 Subject: [PATCH] rtp sout: fix another race condition in RTSP 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 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/stream_out/rtsp.c b/modules/stream_out/rtsp.c index 1f58f75e0e..0d103fa6d2 100644 --- a/modules/stream_out/rtsp.c +++ b/modules/stream_out/rtsp.c @@ -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 ); -- 2.39.2