[vlc-devel] commit: zsh: fix some others memory leaks. ( Rémi Duraffort )

git version control git at videolan.org
Mon Jan 4 00:33:08 CET 2010


vlc | branch: master | Rémi Duraffort <ivoire at videolan.org> | Sun Jan  3 18:43:58 2010 +0100| [2b068d3ac15a96cdd46bd513e89de4452137a656] | committer: Rémi Duraffort 

zsh: fix some others memory leaks.

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

 extras/analyser/zsh.cpp |   12 +++++++-----
 1 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/extras/analyser/zsh.cpp b/extras/analyser/zsh.cpp
index f527dcf..7eb2bf2 100644
--- a/extras/analyser/zsh.cpp
+++ b/extras/analyser/zsh.cpp
@@ -154,6 +154,7 @@ void ParseModules( mumap &mods, mcmap &mods2 )
         while( i_items++ < p_module->i_config_items && p_item++ );
 
     }
+    module_list_free( p_list );
 }
 
 void PrintModuleList( mumap &mods, mcmap &mods2 )
@@ -428,10 +429,12 @@ void PrintOption( char *psz_option, char i_short, char *psz_exclusive,
         strchr( psz_longtext, '(' ) ) psz_longtext = psz_text;
     if( i_short )
     {
-        if( !psz_exclusive ) psz_exclusive = strdup( "" );
-        else asprintf( &psz_exclusive, " %s", psz_exclusive );
-        printf( "  \"(-%c%s)--%s%s[%s]", i_short, psz_exclusive,
-                psz_option, psz_args?"=":"", psz_text );
+        if( !psz_exclusive )
+            printf( "  \"(-%c)--%s%s[%s]", i_short,
+                    psz_option, psz_args?"=":"", psz_text );
+        else
+            printf( "  \"(-%c%s)--%s%s[%s]", i_short, psz_exclusive,
+                    psz_option, psz_args?"=":"", psz_text );
         if( psz_args )
             printf( ":%s:%s\"\\\n", psz_longtext, psz_args );
         else
@@ -456,7 +459,6 @@ void PrintOption( char *psz_option, char i_short, char *psz_exclusive,
             printf( ":%s:%s\"\\\n", psz_longtext, psz_args );
         else
             printf( "\"\\\n" );
-
     }
 }
 




More information about the vlc-devel mailing list