diff options
author | Mark Wielaard <mark@klomp.org> | 2013-06-04 22:02:39 +0200 |
---|---|---|
committer | Noel Power <noel.power@suse.com> | 2013-06-05 08:47:16 +0000 |
commit | 32345f9963dd2900da174d9c7dec6a070fce8f9c (patch) | |
tree | ae8e944a015135292750b86ee2e0e2bbdeb477ad /vcl/unx/gtk | |
parent | 26c4f64a7f7f72e40a3ff1e76eb95a538d1c56db (diff) |
Fix memory leak in SalGtkFilePicker::execute.
The result of g_filename_from_uri should be explicitly freed when done.
Change-Id: I194a562482531aa51cf31ed1f7dbc0ee59054d8b
Reviewed-on: https://gerrit.libreoffice.org/4158
Reviewed-by: Noel Power <noel.power@suse.com>
Tested-by: Noel Power <noel.power@suse.com>
Diffstat (limited to 'vcl/unx/gtk')
-rw-r--r-- | vcl/unx/gtk/fpicker/SalGtkFilePicker.cxx | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/vcl/unx/gtk/fpicker/SalGtkFilePicker.cxx b/vcl/unx/gtk/fpicker/SalGtkFilePicker.cxx index 102e16e552ad..88cb3de954b5 100644 --- a/vcl/unx/gtk/fpicker/SalGtkFilePicker.cxx +++ b/vcl/unx/gtk/fpicker/SalGtkFilePicker.cxx @@ -986,7 +986,8 @@ sal_Int16 SAL_CALL SalGtkFilePicker::execute() throw( uno::RuntimeException ) if( aPathSeq.getLength() == 1 ) { OString sFileName = unicodetouri( aPathSeq[0] ); - if( g_file_test( g_filename_from_uri( sFileName.getStr(), NULL, NULL ), G_FILE_TEST_IS_REGULAR ) ) + gchar *gFileName = g_filename_from_uri ( sFileName.getStr(), NULL, NULL ); + if( g_file_test( gFileName, G_FILE_TEST_IS_REGULAR ) ) { GtkWidget *dlg; INetURLObject aFileObj( sFileName ); @@ -1033,6 +1034,7 @@ sal_Int16 SAL_CALL SalGtkFilePicker::execute() throw( uno::RuntimeException ) gtk_widget_destroy( dlg ); } + g_free (gFileName); if( btn == GTK_RESPONSE_YES ) retVal = ExecutableDialogResults::OK; |