diff options
author | Eduardo Chappa <chappa@washington.edu> | 2018-05-13 01:38:56 -0600 |
---|---|---|
committer | Eduardo Chappa <chappa@washington.edu> | 2018-05-13 01:38:56 -0600 |
commit | aac7b10863bcfabe936feb5151e7e11123e13306 (patch) | |
tree | 8033a31daed6c94fcbdd41eef1682ba0539cfabd /imap | |
parent | 400647dcc1b040f82d22d539fc013f5e23132049 (diff) | |
download | alpine-aac7b10863bcfabe936feb5151e7e11123e13306.tar.xz |
* More changes to make Valgrind happy. Work in progress.
Diffstat (limited to 'imap')
-rw-r--r-- | imap/src/c-client/mail.c | 5 | ||||
-rw-r--r-- | imap/src/c-client/mail.h | 2 | ||||
-rw-r--r-- | imap/src/osdep/nt/env_nt.c | 9 | ||||
-rw-r--r-- | imap/src/osdep/nt/env_nt.h | 1 | ||||
-rw-r--r-- | imap/src/osdep/unix/env_unix.c | 23 | ||||
-rw-r--r-- | imap/src/osdep/unix/env_unix.h | 1 | ||||
-rw-r--r-- | imap/src/osdep/unix/ssl_unix.c | 4 |
7 files changed, 43 insertions, 2 deletions
diff --git a/imap/src/c-client/mail.c b/imap/src/c-client/mail.c index f989e5d9..02519e5a 100644 --- a/imap/src/c-client/mail.c +++ b/imap/src/c-client/mail.c @@ -6402,3 +6402,8 @@ char *net_localhost (NETSTREAM *stream) { return (*stream->dtb->localhost) (stream->stream); } + +void free_c_client_module_globals(void) +{ + env_end(); +} diff --git a/imap/src/c-client/mail.h b/imap/src/c-client/mail.h index f8d44033..11ebdbc9 100644 --- a/imap/src/c-client/mail.h +++ b/imap/src/c-client/mail.h @@ -1883,7 +1883,7 @@ char *sm_read (char *sbname,void **sdb); void ssl_onceonlyinit (void); char *ssl_start_tls (char *s); void ssl_server_init (char *server); - +void free_c_client_module_globals(void); /* Server I/O functions */ diff --git a/imap/src/osdep/nt/env_nt.c b/imap/src/osdep/nt/env_nt.c index d28d30a3..50063ad6 100644 --- a/imap/src/osdep/nt/env_nt.c +++ b/imap/src/osdep/nt/env_nt.c @@ -769,3 +769,12 @@ void *mm_blocknotify (int reason,void *data) } return ret; } + +void env_end(void) +{ + if(myUserName) fs_give((void **) &myUserName); + if(myLocalHost) fs_give((void **) &myLocalHost); + if(myHomeDir) fs_give((void **) &myHomeDir); + if(myNewsrc) fs_give((void **) &myNewsrc); + if(sysInbox) fs_give((void **) &sysInbox); +} diff --git a/imap/src/osdep/nt/env_nt.h b/imap/src/osdep/nt/env_nt.h index dd52f7bc..32b54474 100644 --- a/imap/src/osdep/nt/env_nt.h +++ b/imap/src/osdep/nt/env_nt.h @@ -66,6 +66,7 @@ void unlockfd (int fd,char *lock); long safe_write (int fd,char *buf,long nbytes); void *mm_blocknotify (int reason,void *data); long random (void); +void env_end(void); #if _MSC_VER < 700 #define getpid random #endif diff --git a/imap/src/osdep/unix/env_unix.c b/imap/src/osdep/unix/env_unix.c index 89e50921..44aed22f 100644 --- a/imap/src/osdep/unix/env_unix.c +++ b/imap/src/osdep/unix/env_unix.c @@ -1854,3 +1854,26 @@ void *mm_blocknotify (int reason,void *data) } return ret; } + +void env_end(void) +{ + if(myUserName) fs_give((void **)&myUserName); + if(myHomeDir) fs_give((void **)&myHomeDir); + if(ftpHome) fs_give((void **)&ftpHome); + if(myServerName) fs_give((void **)&myServerName); + if(myLocalHost) fs_give((void **)&myLocalHost); + if(myNewsrc) fs_give((void **)&myNewsrc); + if(mailsubdir) fs_give((void **)&mailsubdir); + if(sysInbox) fs_give((void **)&sysInbox); + if(newsActive) fs_give((void **)&newsActive); + if(newsSpool) fs_give((void **)&newsSpool); + if(blackBoxDir) fs_give((void **)&blackBoxDir); + if(blackBoxDefaultHome) + fs_give((void **)&blackBoxDefaultHome); + if(sslCApath) fs_give((void **)&sslCApath); + if(userFlags){ + int i; + for(i = 0; i < NUSERFLAGS; i++) + if(userFlags[i]) fs_give((void **)&userFlags[i]); + } +} diff --git a/imap/src/osdep/unix/env_unix.h b/imap/src/osdep/unix/env_unix.h index 087430ab..c45cb32d 100644 --- a/imap/src/osdep/unix/env_unix.h +++ b/imap/src/osdep/unix/env_unix.h @@ -90,3 +90,4 @@ long loginpw (struct passwd *pw,int argc,char *argv[]); long pw_login (struct passwd *pw,char *auser,char *user,char *home,int argc, char *argv[]); void *mm_blocknotify (int reason,void *data); +void env_end(void); diff --git a/imap/src/osdep/unix/ssl_unix.c b/imap/src/osdep/unix/ssl_unix.c index 4c4d6ef8..ea2df896 100644 --- a/imap/src/osdep/unix/ssl_unix.c +++ b/imap/src/osdep/unix/ssl_unix.c @@ -404,12 +404,14 @@ static char *ssl_validate_cert (X509 *cert,char *host) "Server name does not match certificate"; /* if mismatch, see if in extensions */ if (ret && (ext = X509_get_ext_d2i (cert,NID_subject_alt_name,NIL,NIL)) && - (n = sk_GENERAL_NAME_num (ext))) + (n = sk_GENERAL_NAME_num (ext))){ /* older versions of OpenSSL use "ia5" instead of dNSName */ for (i = 0; ret && (i < n); i++) if ((name = sk_GENERAL_NAME_value (ext,i)) && (name->type = GEN_DNS) && (s = name->d.ia5->data) && ssl_compare_hostnames (host,s)) ret = NIL; + sk_GENERAL_NAME_pop_free(ext, GENERAL_NAME_free); + } } else ret = "Unable to locate common name in certificate"; return ret; |