[vlc-devel] commit: Fixed use of freed memory every time rtmp access is probed/used. ( Laurent Aimar )

git version control git at videolan.org
Sat Jun 28 23:46:31 CEST 2008


vlc | branch: master | Laurent Aimar <fenrir at videolan.org> | Sat Jun 28 21:40:12 2008 +0000| [9512f7de73883472b39a712748c33e9a51074a02]

Fixed use of freed memory every time rtmp access is probed/used.
(for example, on invalid file ...)

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=9512f7de73883472b39a712748c33e9a51074a02
---

 modules/access/rtmp/access.c |    9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/modules/access/rtmp/access.c b/modules/access/rtmp/access.c
index 8be1e0d..e0416ae 100644
--- a/modules/access/rtmp/access.c
+++ b/modules/access/rtmp/access.c
@@ -242,10 +242,11 @@ error2:
 
     net_Close( p_sys->p_thread->fd );
 error:
+    vlc_UrlClean( &p_sys->p_thread->url );
+
     vlc_object_detach( p_sys->p_thread );
     vlc_object_release( p_sys->p_thread );
 
-    vlc_UrlClean( &p_sys->p_thread->url );
     free( p_sys );
 
     return VLC_EGENERIC;
@@ -286,12 +287,12 @@ static void Close( vlc_object_t * p_this )
 
     var_Destroy( p_access, "rtmp-caching" );
 
-    vlc_object_detach( p_sys->p_thread );
-    vlc_object_release( p_sys->p_thread );
-
     vlc_UrlClean( &p_sys->p_thread->url );
     free( p_sys->p_thread->psz_application );
     free( p_sys->p_thread->psz_media );
+
+    vlc_object_detach( p_sys->p_thread );
+    vlc_object_release( p_sys->p_thread );
     free( p_sys );
 }
 




More information about the vlc-devel mailing list