aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSean Dewar <seandewar@users.noreply.github.com>2021-07-29 22:44:51 +0100
committerSean Dewar <seandewar@users.noreply.github.com>2021-09-16 00:14:46 +0100
commitecb54238e00f66f46070a0a2d859531258377272 (patch)
treebfc16fef90e94f17ef7acf9f5dac4f2411acb2e4 /src
parent9e38c4a79fe0351e9e18bc57cf48b960e8d31e88 (diff)
downloadrneovim-ecb54238e00f66f46070a0a2d859531258377272.tar.gz
rneovim-ecb54238e00f66f46070a0a2d859531258377272.tar.bz2
rneovim-ecb54238e00f66f46070a0a2d859531258377272.zip
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. https://github.com/vim/vim/commit/f2dd9cb9958962302d33fab8fe6439645a2d1e1b
Diffstat (limited to 'src')
-rw-r--r--src/nvim/eval.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/nvim/eval.c b/src/nvim/eval.c
index 903673123c..8777ae1281 100644
--- a/src/nvim/eval.c
+++ b/src/nvim/eval.c
@@ -3799,10 +3799,12 @@ static int eval5(char_u **arg, typval_T *rettv, int evaluate)
} else {
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.
tv_clear(rettv);
+ tv_clear(&var2);
return FAIL;
}
if (var2.v_type == VAR_FLOAT)