From: Gildas Bazin Date: Fri, 23 Apr 2004 06:32:52 +0000 (+0000) Subject: * src/input/subtitles.c: fixed memory leak. X-Git-Tag: 0.7.2~311 X-Git-Url: https://git.sesse.net/?a=commitdiff_plain;h=7fc9581cf4c349135809b7dd22ef8206e960cda4;p=vlc * src/input/subtitles.c: fixed memory leak. --- diff --git a/src/input/subtitles.c b/src/input/subtitles.c index 5eeb98eda0..9ef07f12bd 100644 --- a/src/input/subtitles.c +++ b/src/input/subtitles.c @@ -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 );