o fix another memory leak reported by Martin Kluge (see "[ 599568 ] Small Memory...
authorAlfons Hoogervorst <alfons@proteus.demon.nl>
Sat, 24 Aug 2002 09:21:39 +0000 (09:21 +0000)
committerAlfons Hoogervorst <alfons@proteus.demon.nl>
Sat, 24 Aug 2002 09:21:39 +0000 (09:21 +0000)
o remove 'from' variable from 'summary_set_header()'; we can do with just 'to'

ChangeLog.claws
configure.in
src/summaryview.c

index 0a4f548..cd4cc0b 100644 (file)
@@ -1,3 +1,11 @@
+2002-08-24 [alfons]    0.8.2claws114
+
+       * src/summaryview.c
+               o fix another memory leak reported by Martin Kluge
+                 (see "[ 599568 ] Small Memory Leak")
+               o remove 'from' variable from 'summary_set_header()'; we can
+                 do with just 'to' 
+
 2002-08-24 [paul]      0.8.2claws113
 
        * sync with 0.8.1cvs30
index 470dd70..201a0fd 100644 (file)
@@ -8,7 +8,7 @@ MINOR_VERSION=8
 MICRO_VERSION=1
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=claws113
+EXTRA_VERSION=claws114
 VERSION=$MAJOR_VERSION.$MINOR_VERSION.$MICRO_VERSION$EXTRA_VERSION
 
 dnl set $target
index 9048d28..51e8c26 100644 (file)
@@ -2187,7 +2187,6 @@ static void summary_set_header(SummaryView *summaryview, gchar *text[],
 {
        static gchar date_modified[80];
        static gchar *to = NULL;
-       static gchar *from = NULL;
        static gchar col_score[11];
        static gchar buf[BUFFSIZE];
        gint *col_pos = summaryview->col_pos;
@@ -2225,6 +2224,7 @@ static void summary_set_header(SummaryView *summaryview, gchar *text[],
                                g_free(to);
                                to   = g_strconcat("-->", addr == NULL ? msginfo->to : addr, NULL);
                                text[col_pos[S_COL_FROM]] = to;
+                               g_free(addr);
                        }
                } else {
                        if (cur_account && cur_account->address && !strcmp( addr, cur_account->address)) {
@@ -2241,10 +2241,12 @@ static void summary_set_header(SummaryView *summaryview, gchar *text[],
         * the --> in sent boxes) was executed.
         */
        if (text[col_pos[S_COL_FROM]] != to && prefs_common.use_addr_book && msginfo->from) {
-               g_free(from);
-               from = summary_complete_address(msginfo->from);
-               if (from)
-                       text[col_pos[S_COL_FROM]] = from;
+               gchar *from = summary_complete_address(msginfo->from);
+               if (from) {
+                       g_free(to);
+                       to = from;
+                       text[col_pos[S_COL_FROM]] = to;
+               }                       
        }
 
        if (summaryview->simplify_subject_preg != NULL)