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.
diff --git a/src/evalfunc.c b/src/evalfunc.c
index 632b982..4b34538 100644
--- a/src/evalfunc.c
+++ b/src/evalfunc.c
@@ -1447,6 +1447,8 @@
/* 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);
}
}