aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/terminal.c
diff options
context:
space:
mode:
authorThiago de Arruda <tpadilha84@gmail.com>2015-08-21 23:53:48 -0300
committerThiago de Arruda <tpadilha84@gmail.com>2015-08-22 01:01:14 -0300
commit105a72eabc6f74195b6319471344148726683b9d (patch)
tree55be5a39a0a889393e5540ab6877df7ace796e33 /src/nvim/terminal.c
parentf9778052af733af643444946d33e6e5f9b3fba1b (diff)
downloadrneovim-105a72eabc6f74195b6319471344148726683b9d.tar.gz
rneovim-105a72eabc6f74195b6319471344148726683b9d.tar.bz2
rneovim-105a72eabc6f74195b6319471344148726683b9d.zip
terminal: Fix use after free
Since close_cb may free the terminal structure, save the "wipe" flag before calling it.
Diffstat (limited to 'src/nvim/terminal.c')
-rw-r--r--src/nvim/terminal.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/nvim/terminal.c b/src/nvim/terminal.c
index 931105717b..98fc44c133 100644
--- a/src/nvim/terminal.c
+++ b/src/nvim/terminal.c
@@ -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!");
}
}