[vlc-devel] commit: Fixed a segfault in module_Load in case of error. (Laurent Aimar )

git version control git at videolan.org
Fri Aug 7 00:30:55 CEST 2009


vlc | branch: master | Laurent Aimar <fenrir at videolan.org> | Fri Aug  7 00:26:53 2009 +0200| [9b3a219b6c2c83a752cbab142483ae0551e3818a] | committer: Laurent Aimar 

Fixed a segfault in module_Load in case of error.

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

 src/modules/os.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/src/modules/os.c b/src/modules/os.c
index 28862a2..63df567 100644
--- a/src/modules/os.c
+++ b/src/modules/os.c
@@ -188,12 +188,13 @@ int module_Load( vlc_object_t *p_this, const char *psz_file,
     char *path = ToLocale( psz_file );
 
     handle = dlopen( path, flags );
-    LocaleFree( path );
     if( handle == NULL )
     {
         msg_Warn( p_this, "cannot load module `%s' (%s)", path, dlerror() );
+        LocaleFree( path );
         return -1;
     }
+    LocaleFree( path );
 
 #elif defined(HAVE_DL_SHL_LOAD)
     handle = shl_load( psz_file, BIND_IMMEDIATE | BIND_NONFATAL, NULL );




More information about the vlc-devel mailing list