From 396efdcebcab766d5e72e196ae79856a346cefee Mon Sep 17 00:00:00 2001
From: Alexander Schwinn <alexxcons@xfce.org>
Date: Sun, 30 Apr 2023 23:50:38 +0200
Subject: [PATCH] Prevent minor memory leak (#573)

(cherry picked from commit 193dff6a87c2c9c91563fb49630d1ba97b1c7d93)
---
 thunar/thunar-file.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/thunar/thunar-file.c b/thunar/thunar-file.c
index 4b76508bc..5537d5a4c 100644
--- a/thunar/thunar-file.c
+++ b/thunar/thunar-file.c
@@ -3091,7 +3091,11 @@ thunar_file_can_execute (ThunarFile *file)
   /* Additional security measure only applicable if gvfs is installed: */
   /* Desktop files outside XDG_DATA_DIRS, need to be 'trusted'. */
   if (thunar_g_vfs_metadata_is_supported ())
-    return xfce_g_file_is_trusted (file_to_check->gfile, NULL, NULL);
+    {
+      gboolean can_execute = xfce_g_file_is_trusted (file_to_check->gfile, NULL, NULL);
+      g_object_unref (file_to_check);
+      return can_execute;
+    }
 
    g_object_unref (file_to_check);
    return TRUE;
-- 
GitLab