Skip to content

Commit b301f6b

Browse files
committed
patch 8.0.1492: memory leak in balloon_split()
Problem: Memory leak in balloon_split(). Solution: Free the balloon lines. Free the balloon when exiting.
1 parent a8f04aa commit b301f6b

3 files changed

Lines changed: 8 additions & 0 deletions

File tree

src/evalfunc.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1447,6 +1447,8 @@ f_balloon_split(typval_T *argvars, typval_T *rettv UNUSED)
14471447
/* Skip the first and last item, they are always empty. */
14481448
for (i = 1; i < size - 1; ++i)
14491449
list_append_string(rettv->vval.v_list, array[i].pum_text, -1);
1450+
while (size > 0)
1451+
vim_free(array[--size].pum_text);
14501452
vim_free(array);
14511453
}
14521454
}

src/misc2.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1116,6 +1116,10 @@ free_all_mem(void)
11161116
spell_free_all();
11171117
# endif
11181118

1119+
#if defined(FEAT_INS_EXPAND) && defined(FEAT_BEVAL_TERM)
1120+
ui_remove_balloon();
1121+
# endif
1122+
11191123
# if defined(FEAT_USR_CMDS)
11201124
/* Clear user commands (before deleting buffers). */
11211125
ex_comclear(NULL);

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -771,6 +771,8 @@ static char *(features[]) =
771771

772772
static int included_patches[] =
773773
{ /* Add new patch number below this line */
774+
/**/
775+
1492,
774776
/**/
775777
1491,
776778
/**/

0 commit comments

Comments
 (0)