]> granicus.if.org Git - vim/commitdiff
patch 8.2.2712: memory leak when adding to a blob fails v8.2.2712
authorBram Moolenaar <Bram@vim.org>
Sun, 4 Apr 2021 19:55:23 +0000 (21:55 +0200)
committerBram Moolenaar <Bram@vim.org>
Sun, 4 Apr 2021 19:55:23 +0000 (21:55 +0200)
Problem:    Memory leak when adding to a blob fails.
Solution:   Clear the second typval before returning.

src/eval.c
src/version.c

index 55fda77aa49819bcb96568d7008e699a1b75d23d..d49264997b3e7ed998fd120c9106834b234710d4 100644 (file)
@@ -3008,10 +3008,12 @@ eval5(char_u **arg, typval_T *rettv, evalarg_T *evalarg)
                    n1 = tv_get_number_chk(rettv, &error);
                    if (error)
                    {
-                       // This can only happen for "list + non-list".  For
-                       // "non-list + ..." or "something - ...", we returned
-                       // before evaluating the 2nd operand.
+                       // This can only happen for "list + non-list" or
+                       // "blob + non-blob".  For "non-list + ..." or
+                       // "something - ...", we returned before evaluating the
+                       // 2nd operand.
                        clear_tv(rettv);
+                       clear_tv(&var2);
                        return FAIL;
                    }
 #ifdef FEAT_FLOAT
index c9632c36155afde28b2a105fad17d9625a14dace..986ad77ea1adb4fd7bc3709716e28979371ae145 100644 (file)
@@ -750,6 +750,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    2712,
 /**/
     2711,
 /**/