From 7fc9581cf4c349135809b7dd22ef8206e960cda4 Mon Sep 17 00:00:00 2001 From: Gildas Bazin Date: Fri, 23 Apr 2004 06:32:52 +0000 Subject: [PATCH] * src/input/subtitles.c: fixed memory leak. --- src/input/subtitles.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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 ); -- 2.39.2