[gnome-commander] Fix for memory leaks



commit dde6bb694695bb4d4a6396e7fae950ad0ae6716c
Author: Piotr Eljasiak <epiotr src gnome org>
Date:   Thu Nov 25 22:16:24 2010 +0100

    Fix for memory leaks

 src/gnome-cmd-file-list.cc |    2 +-
 src/utils.cc               |    8 ++++----
 2 files changed, 5 insertions(+), 5 deletions(-)
---
diff --git a/src/gnome-cmd-file-list.cc b/src/gnome-cmd-file-list.cc
index 0509e0a..91a8bfb 100644
--- a/src/gnome-cmd-file-list.cc
+++ b/src/gnome-cmd-file-list.cc
@@ -733,7 +733,7 @@ static char *build_selected_file_list (GnomeCmdFileList *fl, int *file_list_len)
         if (listlen == 1)
         {
             GnomeCmdFile *f = (GnomeCmdFile *) sel_files->data;
-            char *uri_str = g_strdup (f->get_uri_str());
+            char *uri_str = f->get_uri_str();
 
             *file_list_len = strlen (uri_str) + 1;
             return uri_str;
diff --git a/src/utils.cc b/src/utils.cc
index 73b6191..d60f15e 100644
--- a/src/utils.cc
+++ b/src/utils.cc
@@ -581,7 +581,7 @@ void mime_exec_single (GnomeCmdFile *f)
     if (f->is_local())
     {
         args[0] = (gpointer) app;
-        args[1] = (gpointer) g_strdup (f->get_real_path());
+        args[1] = (gpointer) f->get_real_path();
         args[2] = (gpointer) g_path_get_dirname ((gchar *) args[1]);            // set exec dir for local files
         do_mime_exec_single (args);
     }
@@ -590,7 +590,7 @@ void mime_exec_single (GnomeCmdFile *f)
         if (gnome_cmd_app_get_handles_uris (app) && gnome_cmd_data.honor_expect_uris)
         {
             args[0] = (gpointer) app;
-            args[1] = (gpointer) g_strdup (f->get_uri_str());
+            args[1] = (gpointer) f->get_uri_str();
             // args[2] is NULL here (don't set exec dir for remote files)
             do_mime_exec_single (args);
         }
@@ -665,13 +665,13 @@ void mime_exec_multiple (GList *files, GnomeCmdApp *app)
         GnomeCmdFile *f = (GnomeCmdFile *) files->data;
 
         if (gnome_vfs_uri_is_local (f->get_uri()))
-            local_files = g_list_append (local_files, g_strdup (f->get_real_path()));
+            local_files = g_list_append (local_files, f->get_real_path());
         else
         {
             ++no_of_remote_files;
             if (gnome_cmd_app_get_handles_uris (app) && gnome_cmd_data.honor_expect_uris)
             {
-                local_files = g_list_append (local_files,  g_strdup (f->get_uri_str()));
+                local_files = g_list_append (local_files,  f->get_uri_str());
             }
             else
             {



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]