]> granicus.if.org Git - vim/commitdiff
patch 8.2.1070: Vim9: leaking memory when lacking white space in dict v8.2.1070
authorBram Moolenaar <Bram@vim.org>
Sat, 27 Jun 2020 15:04:05 +0000 (17:04 +0200)
committerBram Moolenaar <Bram@vim.org>
Sat, 27 Jun 2020 15:04:05 +0000 (17:04 +0200)
Problem:    Vim9: leaking memory when lacking white space in dict.
Solution:   Clear the typval.

src/dict.c
src/version.c

index 748a9917ebc98d70f03f86bbb986466558169a14..be3282d37ddce32c11a9f0f2f8e5d27d9cf53064 100644 (file)
@@ -862,6 +862,7 @@ eval_dict(char_u **arg, typval_T *rettv, evalarg_T *evalarg, int literal)
        if (vim9script && (*arg)[1] != NUL && !VIM_ISWHITE((*arg)[1]))
        {
            semsg(_(e_white_after), ":");
+           clear_tv(&tvkey);
            goto failret;
        }
 
index 8cef53ef76c96faabd070265d1bf2beaf65ca5c6..a2fadfed64b9b24b8aae496fa2759f57ccc08e68 100644 (file)
@@ -754,6 +754,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    1070,
 /**/
     1069,
 /**/