]> git.sesse.net Git - vlc/commitdiff
analyser/zsh: fix memleak (#2303)
authorRémi Duraffort <ivoire@videolan.org>
Tue, 16 Dec 2008 18:50:09 +0000 (19:50 +0100)
committerRémi Duraffort <ivoire@videolan.org>
Tue, 16 Dec 2008 18:50:09 +0000 (19:50 +0100)
extras/analyser/zsh.cpp

index 77c0436d8760a85428699538070377f04573e0ff..801dbfe552d428dd10aab8df77b2a148a0c0a732 100644 (file)
@@ -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,