diff --git a/thunar/thunar-io-jobs.c b/thunar/thunar-io-jobs.c
index f95246648ad2033c464631121ddbb2f5a12a4c1c..53a22cf841aaca3bcbc6a5f38e19ad4267fe5889 100644
--- a/thunar/thunar-io-jobs.c
+++ b/thunar/thunar-io-jobs.c
@@ -1581,7 +1581,9 @@ _thunar_search_folder (ThunarStandardViewModel           *model,
       /* handle directories */
       if (type == G_FILE_TYPE_DIRECTORY && search_type == THUNAR_STANDARD_VIEW_MODEL_SEARCH_RECURSIVE)
         {
-          _thunar_search_folder (model, job, g_file_get_uri (file), search_query_c_terms, search_type, show_hidden);
+          gchar *file_uri = g_file_get_uri (file);
+          _thunar_search_folder (model, job, file_uri, search_query_c_terms, search_type, show_hidden);
+          g_free (file_uri);
         }
 
       /* prepare entry display name */