From 6fc06defd55e7d00f620d40e52da47bc4c1b3a96 Mon Sep 17 00:00:00 2001 From: Eduardo Chappa Date: Thu, 14 Jun 2018 16:50:18 -0600 Subject: * More changes to make Valgrind happy. --- pith/ablookup.c | 2 ++ pith/bldaddr.c | 6 ++++++ pith/bldaddr.h | 2 +- pith/charconv/filesys.c | 10 ++++++++++ pith/pine.hlp | 2 +- pith/state.c | 5 ++++- 6 files changed, 24 insertions(+), 3 deletions(-) (limited to 'pith') diff --git a/pith/ablookup.c b/pith/ablookup.c index 54336fd9..1b12eba0 100644 --- a/pith/ablookup.c +++ b/pith/ablookup.c @@ -862,6 +862,8 @@ address_is_us(struct mail_address *a, struct pine *ps) ret = 0; if(a && a->host && a->mailbox) snprintf(addrstr, sizeof(addrstr), "%s@%s", a->mailbox, a->host); + else + addrstr[0] = '\0'; for(t = ps_global->VAR_ALT_ADDRS; !ret && t[0] && t[0][0]; t++){ char *alt; diff --git a/pith/bldaddr.c b/pith/bldaddr.c index 2de234bc..3d7b9e7b 100644 --- a/pith/bldaddr.c +++ b/pith/bldaddr.c @@ -1261,3 +1261,9 @@ free_privatetop(PrivateTop **pt) fs_give((void **)pt); } } + +void +free_bldaddr_module_globals(void) +{ + if(last_fcc_used) fs_give((void **)&last_fcc_used); +} diff --git a/pith/bldaddr.h b/pith/bldaddr.h index 0be400be..80e1ccd1 100644 --- a/pith/bldaddr.h +++ b/pith/bldaddr.h @@ -117,6 +117,6 @@ void set_last_fcc(char *); char *get_fcc_based_on_to(ADDRESS *); void free_privatetop(PrivateTop **); void strip_personal_quotes(ADDRESS *); - +void free_bldaddr_module_globals(void); #endif /* PITH_BLDADDR_INCLUDED */ diff --git a/pith/charconv/filesys.c b/pith/charconv/filesys.c index fe989aff..2515c99a 100644 --- a/pith/charconv/filesys.c +++ b/pith/charconv/filesys.c @@ -56,6 +56,11 @@ fname_to_locale(char *fname) static size_t fname_locale_len = 0; char *converted_fname, *p; + if(fname == NULL){ /* special call to free memory */ + if(fname_locale_buf) fs_give((void **) &fname_locale_buf); + return NULL; + } + p = convert_to_locale(fname); if(p) converted_fname = p; @@ -103,6 +108,11 @@ fname_to_utf8(char *fname) static size_t fname_utf8_len = 0; char *converted_fname, *p; + if(fname == NULL){ /* special call to free memory */ + if(fname_utf8_buf) fs_give((void **) &fname_utf8_buf); + return NULL; + } + p = convert_to_utf8(fname, NULL, 0); if(p) converted_fname = p; diff --git a/pith/pine.hlp b/pith/pine.hlp index ebf8b7fb..cc394f1a 100644 --- a/pith/pine.hlp +++ b/pith/pine.hlp @@ -140,7 +140,7 @@ with help text for the config screen and the composer that didn't have any reasonable place to be called from. Dummy change to get revision in pine.hlp ============= h_revision ================= -Alpine Commit 277 2018-05-20 14:52:22 +Alpine Commit 285 2018-06-14 16:50:05 ============= h_news ================= diff --git a/pith/state.c b/pith/state.c index 5d83aba6..f4785850 100644 --- a/pith/state.c +++ b/pith/state.c @@ -34,7 +34,7 @@ static char rcsid[] = "$Id: state.c 1074 2008-06-04 00:08:43Z hubert@u.washingto #include "../pith/list.h" #include "../pith/smime.h" #include "../pith/ical.h" - +#include "../pith/bldaddr.h" /* * Globals referenced throughout pine... @@ -359,4 +359,7 @@ free_pith_module_globals(void) { free_filter_module_globals(); ical_free_all(); + free_bldaddr_module_globals(); + fname_to_locale(NULL); + fname_to_utf8(NULL); } -- cgit v1.2.3-54-g00ecf