terminal: Fix use after free

Since close_cb may free the terminal structure, save the "wipe" flag before
calling it.
This commit is contained in:
Thiago de Arruda
2015-08-21 23:53:48 -03:00
parent f9778052af
commit 105a72eabc
2 changed files with 13 additions and 1 deletions

View File

@@ -422,8 +422,9 @@ end:
redraw(term->buf != curbuf);
ui_busy_stop();
if (close) {
bool wipe = term->buf != NULL;
term->opts.close_cb(term->opts.data);
if (term->buf) {
if (wipe) {
do_cmdline_cmd("bwipeout!");
}
}