[Xfce4-commits] <thunar:master> Fix memory leak thunar_transfer_job_execute().

Jannis Pohlmann noreply at xfce.org
Sun Nov 21 13:44:01 CET 2010


Updating branch refs/heads/master
         to 7978fc31e87754976c033da9b0796df38508d1fd (commit)
       from dc4dc713ed71b8efa22e6b69fccc17eaf56336b1 (commit)

commit 7978fc31e87754976c033da9b0796df38508d1fd
Author: Jannis Pohlmann <jannis at xfce.org>
Date:   Sun Nov 21 13:42:41 2010 +0100

    Fix memory leak thunar_transfer_job_execute().

 thunar/thunar-transfer-job.c |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/thunar/thunar-transfer-job.c b/thunar/thunar-transfer-job.c
index 9add03f..8e3d0ea 100644
--- a/thunar/thunar-transfer-job.c
+++ b/thunar/thunar-transfer-job.c
@@ -669,7 +669,8 @@ thunar_transfer_job_execute (ExoJob  *job,
           target_parent = g_file_get_parent (tp->data);
 
           /* check if the parent exists */
-          parent_exists = g_file_query_exists (target_parent, exo_job_get_cancellable (job));
+          if (target_parent != NULL)
+            parent_exists = g_file_query_exists (target_parent, exo_job_get_cancellable (job));
 
           /* abort on cancellation */
           if (exo_job_set_error_if_cancelled (job, &err))
@@ -678,7 +679,7 @@ thunar_transfer_job_execute (ExoJob  *job,
               break;
             }
 
-          if (G_LIKELY (!parent_exists))
+          if (target_parent != NULL && !parent_exists)
             {
               /* determine the display name of the parent */
               base_name = g_file_get_basename (target_parent);
@@ -724,6 +725,9 @@ thunar_transfer_job_execute (ExoJob  *job,
               /* clean up */
               g_free (parent_display_name);
             }
+
+          if (target_parent != NULL)
+            g_object_unref (target_parent);
         }
       
       if (transfer_job->type == THUNAR_TRANSFER_JOB_MOVE)



More information about the Xfce4-commits mailing list