summaryrefslogtreecommitdiff
path: root/src/terminal.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2019-02-14 23:23:19 +0100
committerBram Moolenaar <Bram@vim.org>2019-02-14 23:23:19 +0100
commit81aa0f56f8be6922730f1ca368d6c64661dc97a3 (patch)
tree26dae5cbb07a1815da3e45a93e2b500d5a3132ee /src/terminal.c
parent29ae223ddcfcbbce46c7e1f4e8fa71b8f2674271 (diff)
downloadvim-git-81aa0f56f8be6922730f1ca368d6c64661dc97a3.tar.gz
patch 8.1.0921: terminal test sometimes fails; using memory after freev8.1.0921
Problem: Terminal test sometimes fails; using memory after free. Solution: Fee memory a bit later. Add test to cover this. Disable flaky screenshot test. (closes #3956)
Diffstat (limited to 'src/terminal.c')
-rw-r--r--src/terminal.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/terminal.c b/src/terminal.c
index f2f4ec0f1..e2ae2f600 100644
--- a/src/terminal.c
+++ b/src/terminal.c
@@ -4735,7 +4735,6 @@ term_load_dump(typval_T *argvars, typval_T *rettv, int do_diff)
p2 += len2;
/* TODO: handle different width */
}
- vim_free(line1);
while (col < width)
{
@@ -4753,6 +4752,8 @@ term_load_dump(typval_T *argvars, typval_T *rettv, int do_diff)
}
++col;
}
+
+ vim_free(line1);
}
if (add_empty_scrollback(term, &term->tl_default_color,
term->tl_top_diff_rows) == OK)