* src/mh.c
authorAlfons Hoogervorst <alfons@proteus.demon.nl>
Sun, 1 Sep 2002 11:28:53 +0000 (11:28 +0000)
committerAlfons Hoogervorst <alfons@proteus.demon.nl>
Sun, 1 Sep 2002 11:28:53 +0000 (11:28 +0000)
plug memleak related to one Martin Kluge found

ChangeLog.claws
configure.in
src/mh.c

index 846d14c..31366f9 100644 (file)
@@ -1,3 +1,8 @@
+2002-0901 [alfons]     0.8.2claws18
+
+       * src/mh.c
+               plug memleak related to one Martin Kluge found
+
 2002-08-31 [paul]      0.8.2claws17
 
        * sync with 0.8.2cvs6
index 898f855..dadda72 100644 (file)
@@ -8,7 +8,7 @@ MINOR_VERSION=8
 MICRO_VERSION=2
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=claws17
+EXTRA_VERSION=claws18
 VERSION=$MAJOR_VERSION.$MINOR_VERSION.$MICRO_VERSION$EXTRA_VERSION
 
 dnl set $target
index 4dd1ee7..865ed85 100644 (file)
--- a/src/mh.c
+++ b/src/mh.c
@@ -456,17 +456,13 @@ static gint mh_do_move(Folder *folder, FolderItem *dest, MsgInfo *msginfo)
        prefs = dest->prefs;
 
        destfile = mh_get_new_msg_filename(dest);
-       g_return_val_if_fail(destfile != NULL, -1);
+       if (!destfile) return -1;
 
+       srcfile = procmsg_get_message_file(msginfo);
+       
        debug_print("Moving message %s%c%d to %s ...\n",
                    msginfo->folder->path, G_DIR_SEPARATOR,
                    msginfo->msgnum, dest->path);
-       srcfile = procmsg_get_message_file(msginfo);
-
-       destfile = mh_get_new_msg_filename(dest);
-       if(!destfile) return -1;
-
-       srcfile = procmsg_get_message_file(msginfo);
 
        if (move_file(srcfile, destfile, FALSE) < 0) {
                g_free(srcfile);
@@ -560,10 +556,8 @@ static gint mh_do_move_msgs_with_dest(Folder *folder, FolderItem *dest,
                            msginfo->msgnum, dest->path);
 
                destfile = mh_get_new_msg_filename(dest);
-               if (!destfile) break;
+               if (!destfile) return -1;
                srcfile = procmsg_get_message_file(msginfo);
-               destfile = mh_get_new_msg_filename(dest);
-               if(!destfile) return -1;
 
                if (move_file(srcfile, destfile, FALSE) < 0) {
                        g_free(srcfile);