[Xfce4-commits] <thunar:master> Plug leak in file renamer (bug #9864).
Nick Schermer
noreply at xfce.org
Mon Apr 29 20:52:01 CEST 2013
Updating branch refs/heads/master
to b43f88ca9a0a7004d8db257e716cc75c23fd67f6 (commit)
from 20780d0c0e186ad8d6a93a42bbb4063918af711c (commit)
commit b43f88ca9a0a7004d8db257e716cc75c23fd67f6
Author: Nick Schermer <nick at xfce.org>
Date: Mon Apr 29 20:49:37 2013 +0200
Plug leak in file renamer (bug #9864).
thunar/thunar-renamer-model.c | 14 +++++++++++---
1 files changed, 11 insertions(+), 3 deletions(-)
diff --git a/thunar/thunar-renamer-model.c b/thunar/thunar-renamer-model.c
index 16ff1d4..853b797 100644
--- a/thunar/thunar-renamer-model.c
+++ b/thunar/thunar-renamer-model.c
@@ -730,15 +730,23 @@ static gboolean
trm_same_directory (ThunarFile *a,
ThunarFile *b)
{
- GFile *parent_a;
- GFile *parent_b;
+ GFile *parent_a;
+ GFile *parent_b;
+ gboolean result;
/* determine the parent paths for both files */
parent_a = g_file_get_parent (thunar_file_get_file (a));
parent_b = g_file_get_parent (thunar_file_get_file (b));
/* check if both files have the same parent */
- return (parent_a != NULL && parent_b != NULL && g_file_equal (parent_a, parent_b));
+ result = (parent_a != NULL && parent_b != NULL && g_file_equal (parent_a, parent_b));
+
+ if (parent_a != NULL)
+ g_object_unref (parent_a);
+ if (parent_b != NULL)
+ g_object_unref (parent_b);
+
+ return result;
}
More information about the Xfce4-commits
mailing list