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