From d01ad8c66d88f085bab082d568f2b8018d33a2db Mon Sep 17 00:00:00 2001 From: Alfons Hoogervorst Date: Sat, 24 Aug 2002 09:21:39 +0000 Subject: [PATCH] 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' --- ChangeLog.claws | 8 ++++++++ configure.in | 2 +- src/summaryview.c | 12 +++++++----- 3 files changed, 16 insertions(+), 6 deletions(-) diff --git a/ChangeLog.claws b/ChangeLog.claws index 0a4f548cd..cd4cc0b3a 100644 --- a/ChangeLog.claws +++ b/ChangeLog.claws @@ -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 diff --git a/configure.in b/configure.in index 470dd70bb..201a0fda1 100644 --- a/configure.in +++ b/configure.in @@ -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 diff --git a/src/summaryview.c b/src/summaryview.c index 9048d28be..51e8c265d 100644 --- a/src/summaryview.c +++ b/src/summaryview.c @@ -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) -- 2.25.1