patch 8.1.0921: terminal test sometimes fails; using memory after free
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)
diff --git a/src/terminal.c b/src/terminal.c
index f2f4ec0..e2ae2f6 100644
--- a/src/terminal.c
+++ b/src/terminal.c
@@ -4735,7 +4735,6 @@
p2 += len2;
/* TODO: handle different width */
}
- vim_free(line1);
while (col < width)
{
@@ -4753,6 +4752,8 @@
}
++col;
}
+
+ vim_free(line1);
}
if (add_empty_scrollback(term, &term->tl_default_color,
term->tl_top_diff_rows) == OK)