]> granicus.if.org Git - vim/commitdiff
patch 8.0.0356: leaking memory when setting 'ttytype' v8.0.0356
authorBram Moolenaar <Bram@vim.org>
Thu, 23 Feb 2017 16:18:37 +0000 (17:18 +0100)
committerBram Moolenaar <Bram@vim.org>
Thu, 23 Feb 2017 16:18:37 +0000 (17:18 +0100)
Problem:    Leaking memory when setting 'ttytype'.
Solution:   Get free_oldval from the right option entry.

src/option.c
src/version.c

index 48a8048cb991da8157a1dd263abed595a201216b..4ba436341d52b27708120773751c9debe3df106f 100644 (file)
@@ -5936,6 +5936,7 @@ did_set_string_option(
            /* Both 'term' and 'ttytype' point to T_NAME, only set the
             * P_ALLOCED flag on 'term'. */
            opt_idx = findoption((char_u *)"term");
+           free_oldval = (options[opt_idx].flags & P_ALLOCED);
        }
     }
 
index 64e11118b5ea1e63b1a048f96928e8fdaf2f95fd..94a325beb5acb7bf8aed4d5d29105a74729d55ac 100644 (file)
@@ -764,6 +764,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    356,
 /**/
     355,
 /**/