0
0
mirror of https://github.com/vim/vim.git synced 2025-10-13 06:54:15 -04:00

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.
This commit is contained in:
Bram Moolenaar
2018-02-10 15:38:35 +01:00
parent a8f04aa275
commit b301f6b950
3 changed files with 8 additions and 0 deletions

View File

@@ -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);
}
}