[vlc-devel] commit: Fix warning ( Rémi Denis-Courmont )

git version control git at videolan.org
Tue Feb 17 21:36:00 CET 2009


vlc | branch: master | Rémi Denis-Courmont <rdenis at simphalempin.com> | Tue Feb 17 22:35:50 2009 +0200| [3c7ab8b5496240a4680c19ad1fab7d919637bbb2] | committer: Rémi Denis-Courmont 

Fix warning

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

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

diff --git a/src/modules/modules.c b/src/modules/modules.c
index 5edffa0..dd026d0 100644
--- a/src/modules/modules.c
+++ b/src/modules/modules.c
@@ -1252,8 +1252,7 @@ static module_t * AllocatePlugin( vlc_object_t * p_this, const char *psz_file )
         return NULL;
     }
 
-    /* We need to fill these since they may be needed by module_Call() */
-    p_module->psz_filename = psz_file;
+    p_module->psz_filename = strdup( psz_file );
     p_module->handle = handle;
     p_module->b_loaded = true;
 
@@ -1261,13 +1260,13 @@ static module_t * AllocatePlugin( vlc_object_t * p_this, const char *psz_file )
     if( module_Call( p_this, p_module ) != 0 )
     {
         /* We couldn't call module_init() */
+        free( p_module->psz_filename );
         module_release( p_module );
         module_Unload( handle );
         return NULL;
     }
 
     DupModule( p_module );
-    p_module->psz_filename = strdup( p_module->psz_filename );
 
     /* Everything worked fine ! The module is ready to be added to the list. */
     p_module->b_builtin = false;




More information about the vlc-devel mailing list