summaryrefslogtreecommitdiff
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
parent992277048fb4c5f380edb8e9247b7e721662ca89 (diff)
downloadalpine-6fc06defd55e7d00f620d40e52da47bc4c1b3a96.tar.xz
* More changes to make Valgrind happy.
-rw-r--r--alpine/alpine.c1
-rw-r--r--alpine/mailcmd.c2
-rw-r--r--alpine/titlebar.c7
-rw-r--r--alpine/titlebar.h1
-rw-r--r--imap/src/c-client/imap4r1.c1
-rw-r--r--imap/src/c-client/mail.c1
-rw-r--r--imap/src/c-client/tcp.h1
-rw-r--r--imap/src/osdep/nt/tcp_nt.c8
-rw-r--r--imap/src/osdep/unix/env_unix.c1
-rw-r--r--imap/src/osdep/unix/tcp_unix.c12
-rw-r--r--imap/src/osdep/unix/unix.c33
-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
17 files changed, 68 insertions, 27 deletions
diff --git a/alpine/alpine.c b/alpine/alpine.c
index 917e0cee..825ef09f 100644
--- a/alpine/alpine.c
+++ b/alpine/alpine.c
@@ -3552,6 +3552,7 @@ free_alpine_module_globals(void)
#endif
free_message_queue();
free_mailcmd_globals();
+ free_titlebar_globals();
}
#ifdef WIN32
diff --git a/alpine/mailcmd.c b/alpine/mailcmd.c
index 8f395a1b..bc6cf947 100644
--- a/alpine/mailcmd.c
+++ b/alpine/mailcmd.c
@@ -9907,7 +9907,7 @@ free_mailcmd_globals(void)
* are hacks to free history memory
*/
smime_import_certificate(NULL, NULL, NULL, 0);
- save_prompt(NULL, NULL, NULL, 0, NULL, NULL, 0, NULL, NULL, NULL);
+ save_prompt(NULL, NULL, NULL, 0, NULL, NULL, 0L, NULL, NULL, NULL);
cmd_export(NULL, NULL, 0, 0);
simple_export(NULL, NULL, CharStar, NULL, NULL);
broach_folder(0, 0, NULL, NULL);
diff --git a/alpine/titlebar.c b/alpine/titlebar.c
index dffdb40d..9f7d3564 100644
--- a/alpine/titlebar.c
+++ b/alpine/titlebar.c
@@ -1261,3 +1261,10 @@ newmail_check_point_cue(int onoroff)
mswin_setcursor (MSWIN_CURSOR_ARROW);
#endif
}
+
+void
+free_titlebar_globals(void)
+{
+ if(as_fname) fs_give((void **) &as_fname);
+ if(as_cname) fs_give((void **) &as_cname);
+}
diff --git a/alpine/titlebar.h b/alpine/titlebar.h
index 41fe3801..f0f3079c 100644
--- a/alpine/titlebar.h
+++ b/alpine/titlebar.h
@@ -50,6 +50,7 @@ void update_titlebar_lpercent(long);
void titlebar_stream_closing(MAILSTREAM *);
int update_titlebar_status(void);
void check_cue_display(char *);
+void free_titlebar_globals(void);
#endif /* PINE_TITLEBAR_INCLUDED */
diff --git a/imap/src/c-client/imap4r1.c b/imap/src/c-client/imap4r1.c
index 343e29bf..b20453ee 100644
--- a/imap/src/c-client/imap4r1.c
+++ b/imap/src/c-client/imap4r1.c
@@ -2951,6 +2951,7 @@ long imap_setid (MAILSTREAM *stream, IDLIST *idlist)
if (imap_OK (stream,reply = imap_send (stream,"ID",args)))
ret = LONGT;
else mm_log (reply->text,ERROR);
+ if(qroot) fs_give((void **) &qroot);
} else mm_log("Empty or malformed ID list", ERROR);
}
else mm_log ("ID capability not available on this IMAP server",ERROR);
diff --git a/imap/src/c-client/mail.c b/imap/src/c-client/mail.c
index b18f7732..3dd45eb5 100644
--- a/imap/src/c-client/mail.c
+++ b/imap/src/c-client/mail.c
@@ -6407,4 +6407,5 @@ char *net_localhost (NETSTREAM *stream)
void free_c_client_module_globals(void)
{
env_end();
+ tcp_end();
}
diff --git a/imap/src/c-client/tcp.h b/imap/src/c-client/tcp.h
index b9f095a8..ecf39bef 100644
--- a/imap/src/c-client/tcp.h
+++ b/imap/src/c-client/tcp.h
@@ -57,3 +57,4 @@ char *tcp_serverhost (void);
long tcp_serverport (void);
char *tcp_canonical (char *name);
long tcp_isclienthost (char *host);
+void tcp_end(void);
diff --git a/imap/src/osdep/nt/tcp_nt.c b/imap/src/osdep/nt/tcp_nt.c
index aeb05a3e..7af6de77 100644
--- a/imap/src/osdep/nt/tcp_nt.c
+++ b/imap/src/osdep/nt/tcp_nt.c
@@ -918,3 +918,11 @@ char *tcp_name_valid (char *s)
}
return ret;
}
+
+void tcp_end(void)
+{
+ if(myClientAddr) fs_give((void **) &myClientAddr);
+ if(myClientHost) fs_give((void **) &myClientHost);
+ if(myServerAddr) fs_give((void **) &myServerAddr);
+ if(myServerHost) fs_give((void **) &myServerHost);
+}
diff --git a/imap/src/osdep/unix/env_unix.c b/imap/src/osdep/unix/env_unix.c
index 44aed22f..322ab61a 100644
--- a/imap/src/osdep/unix/env_unix.c
+++ b/imap/src/osdep/unix/env_unix.c
@@ -1857,6 +1857,7 @@ void *mm_blocknotify (int reason,void *data)
void env_end(void)
{
+ if(myMailboxDir) fs_give((void **) &myMailboxDir);
if(myUserName) fs_give((void **)&myUserName);
if(myHomeDir) fs_give((void **)&myHomeDir);
if(ftpHome) fs_give((void **)&ftpHome);
diff --git a/imap/src/osdep/unix/tcp_unix.c b/imap/src/osdep/unix/tcp_unix.c
index 339c968c..b076ce44 100644
--- a/imap/src/osdep/unix/tcp_unix.c
+++ b/imap/src/osdep/unix/tcp_unix.c
@@ -1066,3 +1066,15 @@ long tcp_isclienthost (char *host)
/* Following statement must be at end of this module */
#undef fork /* undo any use of vfork() */
+
+void tcp_end(void)
+{
+ if(rshcommand) fs_give((void **) &rshcommand);
+ if(rshpath) fs_give((void **) &rshpath);
+ if(sshcommand) fs_give((void **) &sshcommand);
+ if(sshpath) fs_give((void **) &sshpath);
+ if(myClientAddr) fs_give((void **) &myClientAddr);
+ if(myClientHost) fs_give((void **) &myClientHost);
+ if(myServerAddr) fs_give((void **) &myServerAddr);
+ if(myServerHost) fs_give((void **) &myServerHost);
+}
diff --git a/imap/src/osdep/unix/unix.c b/imap/src/osdep/unix/unix.c
index cda5798c..74a1ffa9 100644
--- a/imap/src/osdep/unix/unix.c
+++ b/imap/src/osdep/unix/unix.c
@@ -21,7 +21,7 @@
* Internet: MRC@Washington.EDU
*
* Date: 20 December 1989
- * Last Edited: 27 March 2008
+ * Last Edited: June 13 2018 by Eduardo Chappa
*/
@@ -586,8 +586,15 @@ void unix_close (MAILSTREAM *stream,long options)
* Returns: message header in RFC822 format
*/
- /* lines to filter from header */
-static STRINGLIST *unix_hlines = NIL;
+
+STRINGLIST XIMAPbase = {"X-IMAPbase", 10, NIL};
+STRINGLIST XIMAP = {"X-IMAP", 6, &XIMAPbase};
+STRINGLIST XUID = {"X-UID", 5, &XIMAP};
+STRINGLIST XKeywords = {"X-Keywords", 10, &XUID};
+STRINGLIST XStatus = {"X-Status", 8, &XKeywords};
+STRINGLIST Status = {"Status", 6, &XStatus};
+
+static STRINGLIST *unix_hlines = &Status;
char *unix_header (MAILSTREAM *stream,unsigned long msgno,
unsigned long *length,long flags)
@@ -597,26 +604,6 @@ char *unix_header (MAILSTREAM *stream,unsigned long msgno,
*length = 0; /* default to empty */
if (flags & FT_UID) return "";/* UID call "impossible" */
elt = mail_elt (stream,msgno);/* get cache */
- if (!unix_hlines) { /* once only code */
- STRINGLIST *lines = unix_hlines = mail_newstringlist ();
- lines->text.size = strlen ((char *) (lines->text.data =
- (unsigned char *) "Status"));
- lines = lines->next = mail_newstringlist ();
- lines->text.size = strlen ((char *) (lines->text.data =
- (unsigned char *) "X-Status"));
- lines = lines->next = mail_newstringlist ();
- lines->text.size = strlen ((char *) (lines->text.data =
- (unsigned char *) "X-Keywords"));
- lines = lines->next = mail_newstringlist ();
- lines->text.size = strlen ((char *) (lines->text.data =
- (unsigned char *) "X-UID"));
- lines = lines->next = mail_newstringlist ();
- lines->text.size = strlen ((char *) (lines->text.data =
- (unsigned char *) "X-IMAP"));
- lines = lines->next = mail_newstringlist ();
- lines->text.size = strlen ((char *) (lines->text.data =
- (unsigned char *) "X-IMAPbase"));
- }
/* go to header position */
lseek (LOCAL->fd,elt->private.special.offset +
elt->private.msg.header.offset,L_SET);
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);
}