diff options
author | Eduardo Chappa <chappa@washington.edu> | 2018-06-16 00:36:14 -0600 |
---|---|---|
committer | Eduardo Chappa <chappa@washington.edu> | 2018-06-16 00:36:14 -0600 |
commit | 19dfafb6bc3ed0d37036f21813b753a4dca91e52 (patch) | |
tree | 72ee32d9026dae4d1afb6e349f00375f9f207afe /alpine/mailcmd.c | |
parent | 6fc06defd55e7d00f620d40e52da47bc4c1b3a96 (diff) | |
download | alpine-19dfafb6bc3ed0d37036f21813b753a4dca91e52.tar.xz |
* Fix freeing history memory, and other changes to make Valgrind happy.
Diffstat (limited to 'alpine/mailcmd.c')
-rw-r--r-- | alpine/mailcmd.c | 63 |
1 files changed, 0 insertions, 63 deletions
diff --git a/alpine/mailcmd.c b/alpine/mailcmd.c index bc6cf947..cf61c003 100644 --- a/alpine/mailcmd.c +++ b/alpine/mailcmd.c @@ -382,13 +382,6 @@ smime_import_certificate(char *filename, char *full_filename, char *what, size_t {-1, 0, NULL, NULL}, {-1, 0, NULL, NULL}}; - /* special call to free history */ - if(filename == NULL && full_filename == NULL && what == NULL && len == 0){ - if(history != NULL) - free_hist(&history); - return 0; - } - if(F_ON(F_ENABLE_TAB_COMPLETE,ps_global)){ eopts[r].ch = ctrl('I'); eopts[r].rval = 11; @@ -2779,14 +2772,6 @@ save_prompt(struct pine *state, CONTEXT_S **cntxt, char *nfldr, size_t len_nfldr CONTEXT_S *tc; ESCKEY_S ekey[10]; - if(state == NULL && cntxt == NULL && nfldr == NULL && len_nfldr == 0 - && nmsgs == NULL && env == NULL && rawmsgno == 0L && section == NULL - && dela == NULL && prea == NULL){ - if(history != NULL) - free_hist(&history); - return 0; - } - if(!cntxt) alpine_panic("no context ptr in save_prompt"); @@ -3612,12 +3597,6 @@ cmd_export(struct pine *state, MSGNO_S *msgmap, int qline, int aopt) ESCKEY_S export_opts[5]; static HISTORY_S *history = NULL; - if(state == NULL && msgmap == NULL && qline == 0 && aopt == 0){ - if(history != NULL) - free_hist(&history); - return 0; - } - if(ps_global->restricted){ q_status_message(SM_ORDER, 0, 3, "Alpine demo can't export messages to files"); @@ -4078,13 +4057,6 @@ simple_export(struct pine *ps, void *srctext, SourceType srctype, char *prompt_m {-1, 0, NULL, NULL}, {-1, 0, NULL, NULL}}; - if(ps == NULL && srctext == NULL && srctype == CharStar - && prompt_msg == NULL && lister_msg == NULL){ - if(history != NULL) - free_hist(&history); - return 0; - } - if(F_ON(F_ENABLE_TAB_COMPLETE,ps)){ simple_export_opts[r].ch = ctrl('I'); simple_export_opts[r].rval = 11; @@ -5633,12 +5605,6 @@ broach_folder(int qline, int allow_list, int *notrealinbox, CONTEXT_S **context) ESCKEY_S ekey[9]; int rc, r, ku = -1, n, flags, last_rc = 0, inbox, done = 0; - if(qline == 0 && allow_list == 0 && notrealinbox == NULL && context == NULL){ - if(history != NULL) - free_hist(&history); - return NULL; - } - /* * the idea is to provide a clue for the context the file name * will be saved in (if a non-imap names is typed), and to @@ -6403,12 +6369,6 @@ cmd_pipe(struct pine *state, MSGNO_S *msgmap, int aopt) char pipe_command[MAXPATH]; ESCKEY_S pipe_opt[8]; - if(state == NULL && msgmap == NULL && aopt == 0){ - if(history != NULL) - free_hist(&history); - return 0; - } - if(ps_global->restricted){ q_status_message(SM_ORDER | SM_DING, 0, 4, "Alpine demo can't pipe messages"); @@ -8295,12 +8255,6 @@ select_by_text(MAILSTREAM *stream, MSGNO_S *msgmap, long int msgno, SEARCHSET ** static char *match_me = N_("[Match_My_Addresses]"); static char *dont_match_me = N_("[Don't_Match_My_Addresses]"); - if(stream == NULL && msgmap == NULL && msgno == 0 && limitsrch == NULL){ - if(history != NULL) - free_hist(&history); - return 0; - } - ps_global->mangled_footer = 1; savedsstring[0] = '\0'; ekey[0].ch = ekey[1].ch = ekey[2].ch = ekey[3].ch = -1; @@ -9899,23 +9853,6 @@ print_index(struct pine *state, MSGNO_S *msgmap, int agg) return(1); } - -void -free_mailcmd_globals(void) -{ - /* these calls are not possible during normal operations, so these - * are hacks to free history memory - */ - smime_import_certificate(NULL, NULL, NULL, 0); - 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); - cmd_pipe(NULL, NULL, 0); - select_by_text(NULL, NULL, 0, NULL); -} - - #ifdef _WINDOWS /* |