]> git.sesse.net Git - vlc/commitdiff
* src/input/subtitles.c: fixed memory leak.
authorGildas Bazin <gbazin@videolan.org>
Fri, 23 Apr 2004 06:32:52 +0000 (06:32 +0000)
committerGildas Bazin <gbazin@videolan.org>
Fri, 23 Apr 2004 06:32:52 +0000 (06:32 +0000)
src/input/subtitles.c

index 5eeb98eda0e9702db3acdbbf03585d268872dcd0..9ef07f12bd96f4b80d91e0699ca51608d7f66c47 100644 (file)
@@ -194,10 +194,10 @@ char **subtitles_Detect( input_thread_t *p_this, char *psz_path,
     }
 
     i_max_sub_len = 0;
-    if( i_nb_subdirs >= 0 )
+    if( i_nb_subdirs > 0 )
     {
         char *psz_parser;
-    
+
         subdirs = (char**)malloc( sizeof(char*) * i_nb_subdirs );
         i = 0;
         psz_parser = psz_path;
@@ -374,6 +374,8 @@ char **subtitles_Detect( input_thread_t *p_this, char *psz_path,
         }
     }
 
+    if( subdirs ) free( subdirs );
+
     free( f_dir );
     free( f_fname );
     free( f_fname_noext );