]> git.sesse.net Git - vlc/commitdiff
rtp sout: fix DCCP socket leak
authorPierre Ynard <linkfanel@yahoo.fr>
Thu, 28 Jan 2010 22:58:30 +0000 (23:58 +0100)
committerPierre Ynard <linkfanel@yahoo.fr>
Thu, 28 Jan 2010 22:58:30 +0000 (23:58 +0100)
We need to actually delete the sinks for incoming connections...

modules/stream_out/rtp.c

index ac146cdcda4d7fee10c67336b8d021c1f2d8512f..b19c02bd55fd0fc1a9044768ab17e2ac10e911fe 100644 (file)
@@ -1400,14 +1400,16 @@ static int Del( sout_stream_t *p_stream, sout_stream_id_t *id )
 
     if( id->rtsp_id )
         RtspDelId( p_sys->rtsp, id->rtsp_id );
-    if( id->sinkc > 0 )
-        rtp_del_sink( id, id->sinkv[0].rtp_fd ); /* sink for explicit dst= */
     if( id->listen.fd != NULL )
     {
         vlc_cancel( id->listen.thread );
         vlc_join( id->listen.thread, NULL );
         net_ListenClose( id->listen.fd );
     }
+    /* Delete remaining sinks (incoming connections or explicit
+     * outgoing dst=) */
+    while( id->sinkc > 0 )
+        rtp_del_sink( id, id->sinkv[0].rtp_fd );
 #ifdef HAVE_SRTP
     if( id->srtp != NULL )
         srtp_destroy( id->srtp );