From 4162611e7170f67700b987d2cdbfd9abff7abe32 Mon Sep 17 00:00:00 2001 From: Nick Schermer <nick@xfce.org> Date: Fri, 26 Nov 2010 14:31:00 +0100 Subject: [PATCH] Fix segfault in file reload. Thunar crashed a number of times here when using the pathbar, looking for a file that was constantly rewritten. Valgrind reported a double free on file->display_name and invalid reads as a result of that. --- thunar/thunar-file.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/thunar/thunar-file.c b/thunar/thunar-file.c index 6a341ba30..dc0f59bf4 100644 --- a/thunar/thunar-file.c +++ b/thunar/thunar-file.c @@ -723,13 +723,18 @@ thunar_file_load (ThunarFile *file, /* free the custom icon name */ g_free (file->custom_icon_name); + file->custom_icon_name = NULL; /* free display name and basename */ g_free (file->display_name); + file->display_name = NULL; + g_free (file->basename); + file->basename = NULL; /* free thumbnail path */ g_free (file->thumbnail_path); + file->thumbnail_path = NULL; /* assume the file is mounted by default */ file->is_mounted = TRUE; -- GitLab