Skip to content

Commit 7412123

Browse files
committed
patch 8.0.1080: memory leak for eof_chars terminal option and buffer name
Problem: Memory leak for eof_chars terminal option and buffer name. Solution: Free job options. Free the buffer name
1 parent 09d6c38 commit 7412123

2 files changed

Lines changed: 5 additions & 0 deletions

File tree

src/terminal.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
* in tl_scrollback are no longer used.
3939
*
4040
* TODO:
41+
* - check for memory leaks
4142
* - patch to use GUI or cterm colors for vterm. Yasuhiro, #2067
4243
* - Redirecting output does not work on MS-Windows.
4344
* - implement term_setsize()
@@ -393,6 +394,7 @@ term_start(typval_T *argvar, jobopt_T *opt, int forceit)
393394
vim_snprintf((char *)p, len, "!%s (%d)", cmd, i);
394395
if (buflist_findname(p) == NULL)
395396
{
397+
vim_free(curbuf->b_ffname);
396398
curbuf->b_ffname = p;
397399
break;
398400
}
@@ -552,6 +554,7 @@ ex_terminal(exarg_T *eap)
552554
argvar[1].v_type = VAR_UNKNOWN;
553555
term_start(argvar, &opt, eap->forceit);
554556
vim_free(tofree);
557+
vim_free(opt.jo_eof_chars);
555558
}
556559

557560
/*

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -769,6 +769,8 @@ static char *(features[]) =
769769

770770
static int included_patches[] =
771771
{ /* Add new patch number below this line */
772+
/**/
773+
1080,
772774
/**/
773775
1079,
774776
/**/

0 commit comments

Comments
 (0)