fix another unnoticed leak; cleanup code
authorAlfons Hoogervorst <alfons@proteus.demon.nl>
Sat, 22 Jun 2002 10:08:35 +0000 (10:08 +0000)
committerAlfons Hoogervorst <alfons@proteus.demon.nl>
Sat, 22 Jun 2002 10:08:35 +0000 (10:08 +0000)
ChangeLog.claws
configure.in
src/selective_download.c
src/selective_download.h

index 41a189bc298238e85f5b4372affc2b6723a1d96b..57853d36135aefe482bb4697d11b8ac5769e17f2 100644 (file)
@@ -1,9 +1,14 @@
-2002-06-20 [alfons]
+2002-06-22 [alfons]    0.7.8claws12
+
+       * src/selective_download.[ch]
+               fix another unnoticed leak; cleanup code
+
+2002-06-21 [alfons]
 
        * tools/Makefile.am
                gpg-sign <-- gpg-sign-syl
 
-2002-06-20 [alfons]    0.7.8claws11
+2002-06-21 [alfons]    0.7.8claws11
 
        * src/selective_download.c
        * src/selective_download.h
index ac1ba959bd14151c11ddc07e0499daa8848997f6..b3d92fbfbf7b66e937592061b745074bff7ee0fe 100644 (file)
@@ -8,7 +8,7 @@ MINOR_VERSION=7
 MICRO_VERSION=8
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=claws11
+EXTRA_VERSION=claws12
 VERSION=$MAJOR_VERSION.$MINOR_VERSION.$MICRO_VERSION$EXTRA_VERSION
 
 dnl set $target
index 457c6a5b4f2184aa5b7941b68fed3802e94cf8c2..7b5bcba0ece082c0ae69bda6d5148c4fae6102dc 100644 (file)
@@ -170,6 +170,7 @@ static void sd_clear_msglist()
                acc->msg_list = g_slist_remove(acc->msg_list, item);
                g_free(item->from);
                g_free(item->subject);
+               g_free(item->date);
                g_free(item);
        }       
        g_slist_free(acc->msg_list);
@@ -249,21 +250,14 @@ static MsgInfo *sd_get_msginfo_from_file(const gchar *filename)
 {
        MsgInfo  *msginfo;
        MsgFlags  msgflags = { 0, 0 };
-       gchar     date[HEADER_ITEM_MAX_DATE_SIZE];
+       gchar     date[80];
 
        msginfo = procheader_parse_file(filename, msgflags, TRUE, FALSE);
 
-       /*
-        * ALF - we need to make sure we dynamically allocate interesting 
-        * members, otherwise we can't free the msginfo using 
-        * procmsg_msginfo_free() later on.
-        */
-
-       if (msginfo) {
-               if (msginfo->date_t) {
-                       procheader_date_get_localtime(date, sizeof date, msginfo->date_t);
-                       msginfo->date = g_strdup(date);                                 
-               }                       
+       if (msginfo && msginfo->date_t) {
+               procheader_date_get_localtime(date, sizeof date, msginfo->date_t);
+               if (msginfo->date) g_free(msginfo->date);
+               msginfo->date = g_strdup(date);
        } else 
                msginfo = g_new0(MsgInfo, 1);
 
@@ -393,8 +387,7 @@ static void sd_clist_get_items(void)
                
                items->from        = g_strdup(msginfo->from);
                items->subject     = g_strdup(msginfo->subject);
-               
-               strncpy2(items->date, msginfo->date, sizeof items->date);
+               items->date        = g_strdup(msginfo->date);
                
                msginfo->folder = folder_get_default_processing();
 
index 3018db7cff1e99bf01c604c43b96d5af73a85768..e79d5f4fc1b2f5918d1cd36a2653fbc60419f288 100644 (file)
@@ -22,8 +22,6 @@
 
 #include "mainwindow.h"
 
-#define HEADER_ITEM_MAX_DATE_SIZE      (80)
-
 typedef struct _HeaderItems HeaderItems;
 
 typedef enum {
@@ -40,7 +38,7 @@ struct _HeaderItems {
        SD_State    state;
        gchar       *from;
        gchar       *subject;
-       gchar       date[HEADER_ITEM_MAX_DATE_SIZE];
+       gchar       *date;
        gint        size;
        guint       received : 1;
        guint       del_by_old_session : 1;