patch 8.2.4182: memory leak when evaluating 'diffexpr' v8.2.4182
authorBram Moolenaar <Bram@vim.org>
Sat, 22 Jan 2022 18:21:36 +0000 (18:21 +0000)
committerBram Moolenaar <Bram@vim.org>
Sat, 22 Jan 2022 18:21:36 +0000 (18:21 +0000)
Problem:    Memory leak when evaluating 'diffexpr'.
Solution:   Use free_tv() instead of clear_tv().

src/evalvars.c
src/version.c

index a1d2b9b49b39f6e64ff5a3b630e8b74582757b33..9dbdc75c0c99a241d8b4116c94f33d7a91a8130f 100644 (file)
@@ -429,7 +429,7 @@ eval_diff(
 
     // errors are ignored
     tv = eval_expr(p_dex, NULL);
-    clear_tv(tv);
+    free_tv(tv);
 
     set_vim_var_string(VV_FNAME_IN, NULL, -1);
     set_vim_var_string(VV_FNAME_NEW, NULL, -1);
index cc5c10167dd8ce97ef9bea1e5cf53159881af4d2..fcf40bdb2de65eb330b30d2a683d06ca32ac959a 100644 (file)
@@ -750,6 +750,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    4182,
 /**/
     4181,
 /**/