summaryrefslogtreecommitdiff
path: root/pith
diff options
context:
space:
mode:
authorEduardo Chappa <chappa@washington.edu>2018-06-14 16:50:18 -0600
committerEduardo Chappa <chappa@washington.edu>2018-06-14 16:50:18 -0600
commit6fc06defd55e7d00f620d40e52da47bc4c1b3a96 (patch)
tree8a6c410b0f9280f1b218358ac34178d506b104b6 /pith
parent992277048fb4c5f380edb8e9247b7e721662ca89 (diff)
downloadalpine-6fc06defd55e7d00f620d40e52da47bc4c1b3a96.tar.xz
* More changes to make Valgrind happy.
Diffstat (limited to 'pith')
-rw-r--r--pith/ablookup.c2
-rw-r--r--pith/bldaddr.c6
-rw-r--r--pith/bldaddr.h2
-rw-r--r--pith/charconv/filesys.c10
-rw-r--r--pith/pine.hlp2
-rw-r--r--pith/state.c5
6 files changed, 24 insertions, 3 deletions
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 =================
<HTML>
<HEAD>
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);
}