[vlc-devel] Re: [PATCH] Memory leak in subtitles_Detect() (libvlc)
jmvallat_vlc at mac.com
jmvallat_vlc at mac.com
Thu Dec 15 09:07:47 CET 2005
BTW, DJ, you have committed :
if( i_sub_count >= MAX_SUBTITLE_FILES ) break;
free( p_fixed_name );
+
+ /* scandir() memory clean-up */
+ for( a = 0; a < i_dir_content; a++ ) free
( pp_dir_content[a] );
+ free( pp_dir_content );
}
}
if( j >= 0 ) free( *subdirs++ );
}
... but it should be ...
if( i_sub_count >= MAX_SUBTITLE_FILES ) break;
free( p_fixed_name );
}
+
+ /* scandir() memory clean-up */
+ for( a = 0; a < i_dir_content; a++ ) free( pp_dir_content
[a] );
+ free( pp_dir_content );
}
if( j >= 0 ) free( *subdirs++ );
}
Cheers,
JeanMi.
--
On 15 déc. 05, at 00:15, Derk-Jan Hartman wrote:
> Modified patch applied troughout VLC source code.
> What is your real name if i may ask? i reeally dislike crediting
> people by their email adres :D
>
> DJ
>
> On 14-dec-2005, at 21:43, jmvallat_vlc at mac.com wrote:
>
>> In function subtitles_Detect() (file src/input/subtitles.c), the
>> memory allocated by the scandir() function is never released.
>>
>> --
>>
>> Index: src/input/subtitles.c
>> ===================================================================
>> --- src/input/subtitles.c (revision 13675)
>> +++ src/input/subtitles.c (working copy)
>> @@ -412,6 +412,10 @@
>> if( i_sub_count >= MAX_SUBTITLE_FILES ) break;
>> free( p_fixed_name );
>> }
>> +
>> + /* scandir() memory clean-up */
>> + for( a = 0; a < i_dir_content; a++ ) free
>> ( pp_dir_content[a] );
>> + free( pp_dir_content );
>> }
>> if( j >= 0 ) free( *subdirs++ );
>> }
--
This is the vlc-devel mailing-list, see http://www.videolan.org/vlc/
To unsubscribe, please read http://developers.videolan.org/lists.html
More information about the vlc-devel
mailing list