changeset 24343:7735cbff607d v8.2.2712

patch 8.2.2712: memory leak when adding to a blob fails Commit: https://github.com/vim/vim/commit/f2dd9cb9958962302d33fab8fe6439645a2d1e1b Author: Bram Moolenaar <Bram@vim.org> Date: Sun Apr 4 21:55:23 2021 +0200 patch 8.2.2712: memory leak when adding to a blob fails Problem: Memory leak when adding to a blob fails. Solution: Clear the second typval before returning.
author Bram Moolenaar <Bram@vim.org>
date Sun, 04 Apr 2021 22:00:04 +0200
parents e538d7d1cdd6
children 835e841de7c0
files src/eval.c src/version.c
diffstat 2 files changed, 7 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/src/eval.c
+++ b/src/eval.c
@@ -3008,10 +3008,12 @@ eval5(char_u **arg, typval_T *rettv, eva
 		    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
--- a/src/version.c
+++ b/src/version.c
@@ -751,6 +751,8 @@ static char *(features[]) =
 static int included_patches[] =
 {   /* Add new patch number below this line */
 /**/
+    2712,
+/**/
     2711,
 /**/
     2710,