2009-12-09 [colin] 3.7.3cvs36
authorColin Leroy <colin@colino.net>
Wed, 9 Dec 2009 16:48:40 +0000 (16:48 +0000)
committerColin Leroy <colin@colino.net>
Wed, 9 Dec 2009 16:48:40 +0000 (16:48 +0000)
* src/compose.c
Fix leak and unchecked accesses.

ChangeLog
PATCHSETS
configure.ac
src/compose.c

index 5685d0ad7ec6a83edc2b999a78b0b115ae1b10bf..1d724bc0f5a0f0e43341edecf90b2cf06af39541 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2009-12-09 [colin]     3.7.3cvs36
+
+       * src/compose.c
+               Fix leak and unchecked accesses.
+
 2009-12-09 [mir]       3.7.3cvs35
 
        * src/compose.c
index 77c37ada5f994a8c029fdcf686e02064f30f176b..0d1eb284a01bdb7e079d1ffa340976ab1b37ef68 100644 (file)
--- a/PATCHSETS
+++ b/PATCHSETS
 ( cvs diff -u -r 1.94.2.206 -r 1.94.2.207 src/messageview.c;  ) > 3.7.3cvs33.patchset
 ( cvs diff -u -r 1.382.2.531 -r 1.382.2.532 src/compose.c;  ) > 3.7.3cvs34.patchset
 ( cvs diff -u -r 1.382.2.532 -r 1.382.2.533 src/compose.c;  ) > 3.7.3cvs35.patchset
+( cvs diff -u -r 1.382.2.533 -r 1.382.2.534 src/compose.c;  ) > 3.7.3cvs36.patchset
index e678df95ba4bbe7e95f620e40531ace00f31ef62..e34e385ee39e7d722697ecd02a884607154ceac4 100644 (file)
@@ -12,7 +12,7 @@ MINOR_VERSION=7
 MICRO_VERSION=3
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=35
+EXTRA_VERSION=36
 EXTRA_RELEASE=
 EXTRA_GTK2_VERSION=
 
index 56b990d1973ee1b5ed38c79d9884bf40a0d3c743..c6bf249725a3a2327700da7b26f2a1ca1a638290 100644 (file)
@@ -1178,20 +1178,24 @@ Compose *compose_generic_new(PrefsAccount *account, const gchar *mailto, FolderI
        /* Place cursor according to provided input (mfield) */
        switch (mfield) { 
                case NO_FIELD_PRESENT:
-                       gtk_widget_grab_focus(compose->header_last->entry);
+                       if (compose->header_last)
+                               gtk_widget_grab_focus(compose->header_last->entry);
                        break;
                case TO_FIELD_PRESENT:
                        buf = gtk_editable_get_chars(GTK_EDITABLE(compose->subject_entry), 0, -1);
-                       /*
-                        * buf will always contain an allocated string,
-                        * either empty or populated with some text
-                        */
-                       gtk_entry_set_text(GTK_ENTRY(compose->subject_entry), buf);     
+                       if (buf) {
+                               gtk_entry_set_text(GTK_ENTRY(compose->subject_entry), buf);
+                               g_free(buf);
+                       }
                        gtk_widget_grab_focus(compose->subject_entry);
                        break;
                case SUBJECT_FIELD_PRESENT:
                        textview = GTK_TEXT_VIEW(compose->text);
+                       if (!textview)
+                               break;
                        textbuf = gtk_text_view_get_buffer(textview);
+                       if (!textbuf)
+                               break;
                        mark = gtk_text_buffer_get_insert(textbuf);
                        gtk_text_buffer_get_iter_at_mark(textbuf, &iter, mark);
                        gtk_text_buffer_insert(textbuf, &iter, "", -1);
@@ -8244,6 +8248,8 @@ static void compose_destroy(Compose *compose)
        slist_free_strings(compose->header_list);
        g_slist_free(compose->header_list);
 
+       compose->header_list = compose->newsgroup_list = compose->to_list = NULL;
+
        g_hash_table_destroy(compose->email_hashtable);
 
        procmsg_msginfo_free(compose->targetinfo);