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 /alpine/imap.c | |
parent | 400647dcc1b040f82d22d539fc013f5e23132049 (diff) | |
download | alpine-aac7b10863bcfabe936feb5151e7e11123e13306.tar.xz |
* More changes to make Valgrind happy. Work in progress.
Diffstat (limited to 'alpine/imap.c')
-rw-r--r-- | alpine/imap.c | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/alpine/imap.c b/alpine/imap.c index 5b107600..48ee3606 100644 --- a/alpine/imap.c +++ b/alpine/imap.c @@ -106,6 +106,7 @@ int read_passfile(char *, MMLOGIN_S **); void write_passfile(char *, MMLOGIN_S *); int preserve_prompt(char *); void update_passfile_hostlist(char *, char *, STRLIST_S *, int); +void free_passfile_cache_work(MMLOGIN_S **); static MMLOGIN_S *passfile_cache = NULL; static int using_passfile = -1; @@ -2713,8 +2714,29 @@ get_passfile_passwd(pinerc, passwd, user, hostlist, altflag) : 0); } +void +free_passfile_cache_work(MMLOGIN_S **pwdcache) +{ + if(pwdcache == NULL || *pwdcache == NULL) + return; + + if((*pwdcache)->user) fs_give((void **)&(*pwdcache)->user); +// if((*pwdcache)->passwd) fs_give((void **)&(*pwdcache)->passwd); + if((*pwdcache)->hosts) free_strlist(&(*pwdcache)->hosts); + free_passfile_cache_work(&(*pwdcache)->next); + fs_give((void **)pwdcache); +} + + +void +free_passfile_cache(void) +{ + if(passfile_cache) + free_passfile_cache_work(&passfile_cache); +} + int -is_using_passfile() +is_using_passfile(void) { return(using_passfile == 1); } |