summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2018-02-10 15:38:35 +0100
committerBram Moolenaar <Bram@vim.org>2018-02-10 15:38:35 +0100
commitb301f6b950975b9d7ae87a4f551b32bba63ccdcf (patch)
treef012145cca456fe2f3aa04293fed21afd0f6209b
parenta8f04aa275984183bab5bb583b128f38c64abb69 (diff)
patch 8.0.1492: memory leak in balloon_split()v8.0.1492
Problem: Memory leak in balloon_split(). Solution: Free the balloon lines. Free the balloon when exiting.
-rw-r--r--src/evalfunc.c2
-rw-r--r--src/misc2.c4
-rw-r--r--src/version.c2
3 files changed, 8 insertions, 0 deletions
diff --git a/src/evalfunc.c b/src/evalfunc.c
index 632b982de0..4b34538b7b 100644
--- a/src/evalfunc.c
+++ b/src/evalfunc.c
@@ -1447,6 +1447,8 @@ f_balloon_split(typval_T *argvars, typval_T *rettv UNUSED)
/* Skip the first and last item, they are always empty. */
for (i = 1; i < size - 1; ++i)
list_append_string(rettv->vval.v_list, array[i].pum_text, -1);
+ while (size > 0)
+ vim_free(array[--size].pum_text);
vim_free(array);
}
}
diff --git a/src/misc2.c b/src/misc2.c
index 368303ed9e..0deccdf509 100644
--- a/src/misc2.c
+++ b/src/misc2.c
@@ -1116,6 +1116,10 @@ free_all_mem(void)
spell_free_all();
# endif
+#if defined(FEAT_INS_EXPAND) && defined(FEAT_BEVAL_TERM)
+ ui_remove_balloon();
+# endif
+
# if defined(FEAT_USR_CMDS)
/* Clear user commands (before deleting buffers). */
ex_comclear(NULL);
diff --git a/src/version.c b/src/version.c
index 1bd029555a..be5f864ecf 100644
--- a/src/version.c
+++ b/src/version.c
@@ -772,6 +772,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 1492,
+/**/
1491,
/**/
1490,