Mercurial > mplayer.hg
changeset 35934:445773b8c373
Fix get_current_dir_name_utf8() memory leaks.
author | ib |
---|---|
date | Thu, 21 Mar 2013 09:15:06 +0000 |
parents | de49b61ded49 |
children | 5a953e0b001b |
files | gui/dialog/fileselect.c |
diffstat | 1 files changed, 9 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/gui/dialog/fileselect.c Wed Mar 20 23:08:34 2013 +0000 +++ b/gui/dialog/fileselect.c Thu Mar 21 09:15:06 2013 +0000 @@ -488,10 +488,14 @@ static void fs_Up_released( GtkButton * button, gpointer user_data ) { + char *utf8dir; + chdir( ".." ); fsSelectedFile=fsThatDir; CheckDir( fsFNameList ); - gtk_entry_set_text( GTK_ENTRY( fsPathCombo ),(unsigned char *)get_current_dir_name_utf8() ); + utf8dir = get_current_dir_name_utf8(); + gtk_entry_set_text( GTK_ENTRY( fsPathCombo ),(unsigned char *)utf8dir ); + g_free(utf8dir); return; } @@ -505,10 +509,13 @@ if( ( stat( fsSelectedFile,&fs ) == 0 ) && S_ISDIR( fs.st_mode ) ) { + char *utf8dir; if ( chdir( fsSelectedFile ) != 0 ) return; fsSelectedFile=fsThatDir; CheckDir( fsFNameList ); - gtk_entry_set_text( GTK_ENTRY( fsPathCombo ),(unsigned char *)get_current_dir_name_utf8() ); + utf8dir = get_current_dir_name_utf8(); + gtk_entry_set_text( GTK_ENTRY( fsPathCombo ),(unsigned char *)utf8dir ); + g_free(utf8dir); gtk_widget_grab_focus( fsFNameList ); return; }