Commit 1f1f7a82 authored by Derk-Jan Hartman's avatar Derk-Jan Hartman

* fixed a number of memleaks

parent 7301b09f
......@@ -198,11 +198,12 @@ static ssize_t Read( input_thread_t * p_input, byte_t * p_buffer, size_t i_len )
msg_Dbg( p_input, "opening directory `%s'", psz_name );
if( ReadDir( p_playlist, psz_name , i_mode, &i_pos ) != VLC_SUCCESS )
{
free( psz_name );
goto end;
}
end:
if( psz_name ) free( psz_name );
if( psz_mode ) free( psz_mode );
vlc_object_release( p_playlist );
p_input->b_eof = 1;
return 0;
......
......@@ -444,7 +444,7 @@
return;
}
if( (i_type & VLC_VAR_TYPE) == VLC_VAR_STRING ) free( val.psz_string );
if( val.psz_string ) free( val.psz_string );
if( text.psz_string ) free( text.psz_string );
}
......@@ -534,6 +534,8 @@
if( !strcmp( val.psz_string, val_list.p_list->p_values[i].psz_string ) && !( i_type & VLC_VAR_ISCOMMAND ) )
[o_lmi setState: TRUE ];
free( another_val.psz_string );
break;
case VLC_VAR_INTEGER:
......@@ -559,7 +561,7 @@
}
/* clean up everything */
if( (i_type & VLC_VAR_TYPE) == VLC_VAR_STRING ) free( val.psz_string );
if( val.psz_string ) free( val.psz_string );
var_Change( p_object, psz_variable, VLC_VAR_FREELIST, &val_list, &text_list );
}
......
......@@ -496,13 +496,15 @@ belongs to an Apple hidden private API, and then can "disapear" at any time*/
do
{
char *psz_temp;
i_current++;
vlc_mutex_lock( &p_playlist->object_lock );
o_current_name = [NSString stringWithUTF8String:
p_playlist->pp_items[i_current]->input.psz_name];
o_current_author = [NSString stringWithUTF8String:
playlist_GetInfo(p_playlist, i_current ,_("General"),_("Author") )];
psz_temp = playlist_GetInfo(p_playlist, i_current ,_("General"),_("Author") );
o_current_author = [NSString stringWithUTF8String: psz_temp];
free( psz_temp);
vlc_mutex_unlock( &p_playlist->object_lock );
......@@ -876,13 +878,24 @@ belongs to an Apple hidden private API, and then can "disapear" at any time*/
}
else if( [[o_tc identifier] isEqualToString:@"2"] )
{
char *psz_temp;
vlc_mutex_lock( &p_playlist->object_lock );
o_value = [NSString stringWithUTF8String:
playlist_GetInfo(p_playlist, i_row ,_("General"),_("Author") )];
if( o_value == NULL )
o_value = [NSString stringWithCString:
playlist_GetInfo(p_playlist, i_row ,_("General"),_("Author") )];
psz_temp = playlist_GetInfo( p_playlist, i_row ,_("General"),_("Author") );
vlc_mutex_unlock( &p_playlist->object_lock );
if( psz_temp == NULL )
{
o_value = @"";
}
else
{
o_value = [NSString stringWithUTF8String: psz_temp];
if( o_value == NULL )
{
o_value = [NSString stringWithCString: psz_temp];
}
free( psz_temp );
}
}
else if( [[o_tc identifier] isEqualToString:@"3"] )
{
......
......@@ -116,8 +116,10 @@
FIND_ANYWHERE );
if (p_playlist)
if( p_playlist )
{
char *psz_temp;
/*fill uri / title / author info */
[o_uri_txt setStringValue:
([NSString stringWithUTF8String:p_playlist->
......@@ -135,9 +137,9 @@
[NSString stringWithUTF8String:p_playlist->
pp_items[i_item]->input.psz_name]];
[o_author_txt setStringValue:
[NSString stringWithUTF8String:playlist_GetInfo
(p_playlist, i_item ,_("General"),_("Author") )]];
psz_temp = playlist_GetInfo( p_playlist, i_item ,_("General"),_("Author") );
[o_author_txt setStringValue: [NSString stringWithUTF8String: psz_temp]];
free( psz_temp );
[[VLCInfoTreeItem rootItem] refresh];
[o_outline_view reloadData];
......
......@@ -1122,6 +1122,7 @@ static int InitThread( input_thread_t * p_input )
free( *tmp2++ );
}
free( tmp );
free( val1.psz_string );
}
if( psz_sub_file ) free( psz_sub_file );
......
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