]> granicus.if.org Git - vim/commitdiff
patch 8.0.1080: memory leak for eof_chars terminal option and buffer name v8.0.1080
authorBram Moolenaar <Bram@vim.org>
Sat, 9 Sep 2017 14:34:32 +0000 (16:34 +0200)
committerBram Moolenaar <Bram@vim.org>
Sat, 9 Sep 2017 14:34:32 +0000 (16:34 +0200)
Problem:    Memory leak for eof_chars terminal option and buffer name.
Solution:   Free job options. Free the buffer name

src/terminal.c
src/version.c

index c4313eeabc7ef245883c230a9cc8c6d0a5922347..258f4f09d1a6e61c80a73011a6dd8c569fb619c9 100644 (file)
@@ -38,6 +38,7 @@
  * in tl_scrollback are no longer used.
  *
  * TODO:
+ * - check for memory leaks
  * - patch to use GUI or cterm colors for vterm. Yasuhiro, #2067
  * - Redirecting output does not work on MS-Windows.
  * - implement term_setsize()
@@ -393,6 +394,7 @@ term_start(typval_T *argvar, jobopt_T *opt, int forceit)
                vim_snprintf((char *)p, len, "!%s (%d)", cmd, i);
            if (buflist_findname(p) == NULL)
            {
+               vim_free(curbuf->b_ffname);
                curbuf->b_ffname = p;
                break;
            }
@@ -552,6 +554,7 @@ ex_terminal(exarg_T *eap)
     argvar[1].v_type = VAR_UNKNOWN;
     term_start(argvar, &opt, eap->forceit);
     vim_free(tofree);
+    vim_free(opt.jo_eof_chars);
 }
 
 /*
index 94ba24dbbe8173ebb5ad83ff191c8f6aa0d4a59a..989fe042752b2e51220ce4eb962648d911ad4595 100644 (file)
@@ -769,6 +769,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    1080,
 /**/
     1079,
 /**/