[vlc-devel] commit: analyser/zsh: fix memleak (#2303) ( Rémi Duraffort )

git version control git at videolan.org
Tue Dec 16 19:51:22 CET 2008


vlc | branch: master | Rémi Duraffort <ivoire at videolan.org> | Tue Dec 16 19:50:09 2008 +0100| [358afe661f7780262e5dcc4b964ae6b9fbd745ca] | committer: Rémi Duraffort 

analyser/zsh: fix memleak (#2303)

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

 extras/analyser/zsh.cpp |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/extras/analyser/zsh.cpp b/extras/analyser/zsh.cpp
index 77c0436..801dbfe 100644
--- a/extras/analyser/zsh.cpp
+++ b/extras/analyser/zsh.cpp
@@ -209,7 +209,7 @@ void PrintModuleList( libvlc_int_t *p_libvlc, mumap &mods, mcmap &mods2 )
 
 void ParseOption( module_config_t *p_item, mumap &mods, mcmap &mods2 )
 {
-    char *psz_arguments = strdup( "" );
+    char *psz_arguments = NULL;
     char *psz_exclusive;
     char *psz_option;
     char *psz_name;
@@ -361,7 +361,6 @@ void ParseOption( module_config_t *p_item, mumap &mods, mcmap &mods2 )
 
     case CONFIG_ITEM_BOOL:
 //        p_control = new BoolConfigControl( p_this, p_item, parent );
-        psz_arguments = NULL;
         asprintf( &psz_exclusive, "--no%s --no-%s", p_item->psz_name,
                  p_item->psz_name );
         psz_name = DUP( p_item->psz_name );
@@ -412,6 +411,7 @@ void ParseOption( module_config_t *p_item, mumap &mods, mcmap &mods2 )
     free( psz_name );
     free( psz_text );
     free( psz_longtext );
+    free( psz_arguments );
 }
 
 void PrintOption( char *psz_option, char i_short, char *psz_exclusive,




More information about the vlc-devel mailing list