From 126c9d80cee8f0f7f4559115f26f9891bd966d67 Mon Sep 17 00:00:00 2001 From: Andrej Kacian Date: Wed, 10 Feb 2016 18:30:20 +0100 Subject: [PATCH] Fix a segfault caused by freeing a string on incorrect place. Closes bug #3616. --- src/mh.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/mh.c b/src/mh.c index b9036aa53..0736e58e0 100644 --- a/src/mh.c +++ b/src/mh.c @@ -272,11 +272,12 @@ static void mh_get_last_num(Folder *folder, FolderItem *item) if (max < num) max = num; } + g_free(fullpath); + if (num % 2000 == 0) GTK_EVENTS_FLUSH(); } g_dir_close(dp); - g_free(fullpath); g_free(path); debug_print("Last number in dir %s = %d\n", item->path?item->path:"(null)", max); -- 2.25.1