mirror of
https://github.com/neovim/neovim.git
synced 2025-09-23 11:38:31 +00:00
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:
@@ -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!");
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user