mirror of
https://github.com/vim/vim.git
synced 2025-09-24 03:44:06 -04:00
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.
This commit is contained in:
@@ -3008,10 +3008,12 @@ eval5(char_u **arg, typval_T *rettv, evalarg_T *evalarg)
|
|||||||
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.
|
||||||
clear_tv(rettv);
|
clear_tv(rettv);
|
||||||
|
clear_tv(&var2);
|
||||||
return FAIL;
|
return FAIL;
|
||||||
}
|
}
|
||||||
#ifdef FEAT_FLOAT
|
#ifdef FEAT_FLOAT
|
||||||
|
@@ -750,6 +750,8 @@ static char *(features[]) =
|
|||||||
|
|
||||||
static int included_patches[] =
|
static int included_patches[] =
|
||||||
{ /* Add new patch number below this line */
|
{ /* Add new patch number below this line */
|
||||||
|
/**/
|
||||||
|
2712,
|
||||||
/**/
|
/**/
|
||||||
2711,
|
2711,
|
||||||
/**/
|
/**/
|
||||||
|
Reference in New Issue
Block a user