From: Bram Moolenaar Date: Sun, 4 Apr 2021 19:55:23 +0000 (+0200) Subject: patch 8.2.2712: memory leak when adding to a blob fails X-Git-Tag: v8.2.2712 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=f2dd9cb9958962302d33fab8fe6439645a2d1e1b;p=vim 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. --- diff --git a/src/eval.c b/src/eval.c index 55fda77aa..d49264997 100644 --- a/src/eval.c +++ b/src/eval.c @@ -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 diff --git a/src/version.c b/src/version.c index c9632c361..986ad77ea 100644 --- a/src/version.c +++ b/src/version.c @@ -750,6 +750,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 2712, /**/ 2711, /**/