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 b9036aa..0736e58 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;
                }
                        if (max < num)
                                max = num;
                }
+               g_free(fullpath);
+
                if (num % 2000 == 0)
                        GTK_EVENTS_FLUSH();
        }
        g_dir_close(dp);
                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);
        g_free(path);
 
        debug_print("Last number in dir %s = %d\n", item->path?item->path:"(null)", max);