mirror of
https://github.com/neovim/neovim.git
synced 2024-12-25 05:35:10 -07:00
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.
f2dd9cb995
This commit is contained in:
parent
9e38c4a79f
commit
ecb54238e0
@ -3799,10 +3799,12 @@ static int eval5(char_u **arg, typval_T *rettv, int evaluate)
|
|||||||
} else {
|
} else {
|
||||||
n1 = tv_get_number_chk(rettv, &error);
|
n1 = tv_get_number_chk(rettv, &error);
|
||||||
if (error) {
|
if (error) {
|
||||||
/* This can only happen for "list + non-list". For
|
// This can only happen for "list + non-list" or
|
||||||
* "non-list + ..." or "something - ...", we returned
|
// "blob + non-blob". For "non-list + ..." or
|
||||||
* before evaluating the 2nd operand. */
|
// "something - ...", we returned before evaluating the
|
||||||
|
// 2nd operand.
|
||||||
tv_clear(rettv);
|
tv_clear(rettv);
|
||||||
|
tv_clear(&var2);
|
||||||
return FAIL;
|
return FAIL;
|
||||||
}
|
}
|
||||||
if (var2.v_type == VAR_FLOAT)
|
if (var2.v_type == VAR_FLOAT)
|
||||||
|
Loading…
Reference in New Issue
Block a user