comparison src/terminal.c @ 15828:8f112782a2e9 v8.1.0921

patch 8.1.0921: terminal test sometimes fails; using memory after free commit https://github.com/vim/vim/commit/81aa0f56f8be6922730f1ca368d6c64661dc97a3 Author: Bram Moolenaar <Bram@vim.org> Date: Thu Feb 14 23:23:19 2019 +0100 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)
author Bram Moolenaar <Bram@vim.org>
date Thu, 14 Feb 2019 23:30:05 +0100
parents 1f2edc01e7ed
children 85c94163c4ab
comparison
equal deleted inserted replaced
15827:9186eec7512b 15828:8f112782a2e9
4733 } 4733 }
4734 p1 += len1; 4734 p1 += len1;
4735 p2 += len2; 4735 p2 += len2;
4736 /* TODO: handle different width */ 4736 /* TODO: handle different width */
4737 } 4737 }
4738 vim_free(line1);
4739 4738
4740 while (col < width) 4739 while (col < width)
4741 { 4740 {
4742 if (*p1 == NUL && *p2 == NUL) 4741 if (*p1 == NUL && *p2 == NUL)
4743 textline[col] = '?'; 4742 textline[col] = '?';
4751 textline[col] = '-'; 4750 textline[col] = '-';
4752 p1 += utfc_ptr2len(p1); 4751 p1 += utfc_ptr2len(p1);
4753 } 4752 }
4754 ++col; 4753 ++col;
4755 } 4754 }
4755
4756 vim_free(line1);
4756 } 4757 }
4757 if (add_empty_scrollback(term, &term->tl_default_color, 4758 if (add_empty_scrollback(term, &term->tl_default_color,
4758 term->tl_top_diff_rows) == OK) 4759 term->tl_top_diff_rows) == OK)
4759 ml_append(term->tl_top_diff_rows + lnum, textline, 0, FALSE); 4760 ml_append(term->tl_top_diff_rows + lnum, textline, 0, FALSE);
4760 ++bot_lnum; 4761 ++bot_lnum;