vcl/unx/gtk/fpicker/SalGtkFilePicker.cxx |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

New commits:
commit 32345f9963dd2900da174d9c7dec6a070fce8f9c
Author: Mark Wielaard <[email protected]>
Date:   Tue Jun 4 22:02:39 2013 +0200

    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 <[email protected]>
    Tested-by: Noel Power <[email protected]>

diff --git a/vcl/unx/gtk/fpicker/SalGtkFilePicker.cxx 
b/vcl/unx/gtk/fpicker/SalGtkFilePicker.cxx
index 102e16e..88cb3de 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;
_______________________________________________
Libreoffice-commits mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to