2004-11-16 [colin] 0.9.12cvs147.1
authorColin Leroy <colin@colino.net>
Tue, 16 Nov 2004 15:39:31 +0000 (15:39 +0000)
committerColin Leroy <colin@colino.net>
Tue, 16 Nov 2004 15:39:31 +0000 (15:39 +0000)
* src/procmsg.c
Sync with Main (leak fix)

ChangeLog-gtk2.claws
PATCHSETS
configure.ac
src/procmsg.c

index 3c16bb665eed922b16ce49cab9a67e9d722d3616..d6218b3555f49a3b26fdcce84b8f29d5d442b100 100644 (file)
@@ -1,3 +1,8 @@
+2004-11-16 [colin]     0.9.12cvs147.1
+
+       * src/procmsg.c
+               Sync with Main (leak fix)
+
 2004-11-16 [colin]     0.9.12cvs146.14
 
        * src/compose.c
index 4f4885b9a681c52663e7a2e1abf02359df8e1e8f..90c036dcc0da50ee704945e8de54f117100a2dfc 100644 (file)
--- a/PATCHSETS
+++ b/PATCHSETS
 ( cvs diff -u -r 1.382.2.64 -r 1.382.2.65 src/compose.c; cvs diff -u -r 1.59.2.9 -r 1.59.2.10 src/prefs_filtering.c; cvs diff -u -r 1.1.4.8 -r 1.1.4.9 src/prefs_filtering_action.c; cvs diff -u -r 1.30.2.6 -r 1.30.2.7 src/prefs_toolbar.c; ) > 0.9.12cvs146.12.patchset
 ( cvs diff -u -r 1.382.2.65 -r 1.382.2.66 src/compose.c; ) > 0.9.12cvs146.13.patchset
 ( cvs diff -u -r 1.382.2.66 -r 1.382.2.67 src/compose.c; ) > 0.9.12cvs146.14.patchset
+( cvs diff -u -r 1.150.2.12 -r 1.150.2.13 src/procmsg.c; ) > 0.9.12cvs147.1.patchset
index 271f04e4635110bbdd60ca5709bbafc3e6f39e6e..d7285d46e43fb60c0e63ac9837f2dfeb85e23c59 100644 (file)
@@ -11,9 +11,9 @@ MINOR_VERSION=9
 MICRO_VERSION=12
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=146
+EXTRA_VERSION=147
 EXTRA_RELEASE=
-EXTRA_GTK2_VERSION=.14
+EXTRA_GTK2_VERSION=.1
 
 if test \( $EXTRA_VERSION -eq 0 \) -o \( "x$EXTRA_RELEASE" != "x" \); then
     VERSION=${MAJOR_VERSION}.${MINOR_VERSION}.${MICRO_VERSION}${EXTRA_RELEASE}${EXTRA_GTK2_VERSION}
index 21f88b3f0beeaa4fdcd5c280e059ed4185ec71af..accc7f2335ca832145a8f7372321945b76bdf0eb 100644 (file)
@@ -1109,34 +1109,43 @@ gint procmsg_send_message_queue(const gchar *file)
                        if (!fwdmessageid) fwdmessageid = g_strdup(p);
                        break;
                case Q_PRIVACY_SYSTEM:
-                       if (privacy_system == NULL) privacy_system = g_strdup(p);
+                       if (!privacy_system) privacy_system = g_strdup(p);
                        break;
                case Q_ENCRYPT:
                        if (p[0] == '1') encrypt = TRUE;
                        break;
                case Q_ENCRYPT_DATA:
-                       if (encrypt_data == NULL) encrypt_data = g_strdup(p);
+                       if (!encrypt_data) encrypt_data = g_strdup(p);
                        break;
                }
        }
        filepos = ftell(fp);
 
        if (encrypt) {
-               /* FIXME: memory leaks, in case of errors */
                MimeInfo *mimeinfo;
 
                fclose(fp);
-
+               
                mimeinfo = procmime_scan_queue_file(file);
-               if (!privacy_encrypt(privacy_system, mimeinfo, encrypt_data))
-                       return -1;
-
-               fp = my_tmpfile();
-               if (procmime_write_mimeinfo(mimeinfo, fp) < 0) {
-                       fclose(fp);
+               if (!privacy_encrypt(privacy_system, mimeinfo, encrypt_data)
+               || (fp = my_tmpfile()) == NULL
+               ||  procmime_write_mimeinfo(mimeinfo, fp) < 0) {
+                       if (fp)
+                               fclose(fp);
+                       procmime_mimeinfo_free_all(mimeinfo);
+                       g_free(from);
+                       g_free(smtpserver);
+                       slist_free_strings(to_list);
+                       g_slist_free(to_list);
+                       slist_free_strings(newsgroup_list);
+                       g_slist_free(newsgroup_list);
+                       g_free(savecopyfolder);
+                       g_free(replymessageid);
+                       g_free(fwdmessageid);
+                       g_free(privacy_system);
+                       g_free(encrypt_data);
                        return -1;
                }
-               procmime_mimeinfo_free_all(mimeinfo);
                        
                rewind(fp);
                filepos = 0;
@@ -1221,12 +1230,6 @@ gint procmsg_send_message_queue(const gchar *file)
                g_free(tmp);
        }
 
-       slist_free_strings(to_list);
-       g_slist_free(to_list);
-       slist_free_strings(newsgroup_list);
-       g_slist_free(newsgroup_list);
-       g_free(from);
-       g_free(smtpserver);
        fclose(fp);
 
        /* save message to outbox */
@@ -1284,10 +1287,18 @@ gint procmsg_send_message_queue(const gchar *file)
                g_strfreev(tokens);
        }
 
+       g_free(from);
+       g_free(smtpserver);
+       slist_free_strings(to_list);
+       g_slist_free(to_list);
+       slist_free_strings(newsgroup_list);
+       g_slist_free(newsgroup_list);
        g_free(savecopyfolder);
        g_free(replymessageid);
        g_free(fwdmessageid);
-       
+       g_free(privacy_system);
+       g_free(encrypt_data);
+
        return (newsval != 0 ? newsval : mailval);
 }