Commit 7fc9581c authored by Gildas Bazin's avatar Gildas Bazin

* src/input/subtitles.c: fixed memory leak.

parent 3bda52ae
......@@ -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 );
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment