Fix a segfault caused by freeing a string on incorrect place.
authorAndrej Kacian <ticho@claws-mail.org>
Wed, 10 Feb 2016 17:30:20 +0000 (18:30 +0100)
committerAndrej Kacian <ticho@claws-mail.org>
Wed, 10 Feb 2016 17:30:20 +0000 (18:30 +0100)
Closes bug #3616.

src/mh.c

index b9036aa536dc31d29cdb954ab016ff21ec92c5fb..0736e58e08b903a59d76a21e63f4b2ac787f83ea 100644 (file)
--- 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);