[vlc-devel] commit: Fix "Use after free" (CID 248) ( Rémi Duraffort )

git version control git at videolan.org
Wed Oct 1 20:17:56 CEST 2008


vlc | branch: master | Rémi Duraffort <ivoire at videolan.org> | Wed Oct  1 20:01:12 2008 +0200| [d12f65f6209a8f3a71ab921b9bd77b4c65851f0d] | committer: Rémi Duraffort 

Fix "Use after free" (CID 248)

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

 src/control/media_discoverer.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/control/media_discoverer.c b/src/control/media_discoverer.c
index c1b811b..a087549 100644
--- a/src/control/media_discoverer.c
+++ b/src/control/media_discoverer.c
@@ -178,9 +178,9 @@ libvlc_media_discoverer_new_from_name( libvlc_instance_t * p_inst,
 
     if( !p_mdis->p_sd )
     {
-        free( p_mdis );
         libvlc_media_list_release( p_mdis->p_mlist );
         libvlc_exception_raise( p_e, "Can't find the services_discovery module named '%s'", psz_name );
+        free( p_mdis );
         return NULL;
     }
 
@@ -205,9 +205,9 @@ libvlc_media_discoverer_new_from_name( libvlc_instance_t * p_inst,
     bool ret = services_discovery_Start( p_mdis->p_sd );
     if(!ret)
     {
-        free( p_mdis );
         libvlc_media_list_release( p_mdis->p_mlist );
         libvlc_exception_raise( p_e, "Can't start the services_discovery module named '%s'", psz_name );
+        free( p_mdis );
         return NULL;
     }
 




More information about the vlc-devel mailing list