From dba258fd9b3e1730d9a6d7a46e1c5e54d3179663 Mon Sep 17 00:00:00 2001 From: Richard Russon Date: Tue, 9 Apr 2019 14:44:15 +0100 Subject: [PATCH] fix crash on startup Allocate the 'folder' earlier. Our code paths seem to differ from upstream's. --- main.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/main.c b/main.c index 66d4b8854..656455b2c 100644 --- a/main.c +++ b/main.c @@ -404,7 +404,6 @@ bool get_user_info(struct ConfigSet *cs) */ int main(int argc, char *argv[], char *envp[]) { - struct Buffer *folder = NULL; char *subject = NULL; char *include_file = NULL; char *draft_file = NULL; @@ -436,6 +435,7 @@ int main(int argc, char *argv[], char *envp[]) int double_dash = argc, nargc = 1; int rc = 1; bool repeat_error = false; + struct Buffer *folder = mutt_buffer_new(); MuttLogger = log_disp_terminal; @@ -514,8 +514,6 @@ int main(int argc, char *argv[], char *envp[]) mutt_list_insert_tail(&Muttrc, mutt_str_strdup(optarg)); break; case 'f': - if (!folder) - folder = mutt_buffer_new(); mutt_buffer_strcpy(folder, optarg); explicit_folder = true; break; -- 2.40.0