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. --- imap/src/osdep/unix/env_unix.c | 1 + imap/src/osdep/unix/tcp_unix.c | 12 ++++++++++++ imap/src/osdep/unix/unix.c | 33 ++++++++++----------------------- 3 files changed, 23 insertions(+), 23 deletions(-) (limited to 'imap/src/osdep/unix') 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); -- cgit v1.2.3-54-g00ecf