mutt_select_fcc() calls mutt_addr_hook() -> mutt_make_string() which
refers to MuttIndexWindow->cols when calling mutt_FormatString(). In
batch mode, MuttIndexWindow hasn't been initialized, leading to a
segfault.
This might be the only overlap, but it seems wiser to just initialize
the mutt windows in case there are other references (now or in the
future) when processing format strings in batch mode.
#ifdef USE_SIDEBAR
MuttSidebarWindow = safe_calloc (sizeof (mutt_window_t), 1);
#endif
-
- mutt_reflow_windows ();
}
void mutt_free_windows ()
meta (stdscr, TRUE);
#endif
init_extended_keys();
- mutt_init_windows ();
+ mutt_reflow_windows ();
}
#define MUTT_IGNORE (1<<0) /* -z */
sendflags = SENDBATCH;
}
+ /* Always create the mutt_windows because batch mode has some shared code
+ * paths that end up referencing them. */
+ mutt_init_windows ();
+
/* This must come before mutt_init() because curses needs to be started
before calling the init_pair() function to set the color scheme. */
if (!option (OPTNOCURSES))
FREE (&tempfile);
}
+ mutt_free_windows ();
if (!option (OPTNOCURSES))
- {
- mutt_free_windows ();
mutt_endwin (NULL);
- }
if (rv)
exit(1);