patch 8.1.2107: various memory leaks reported by asan
Problem: Various memory leaks reported by asan.
Solution: Free the memory. (Ozaki Kiichi, closes #5003)
diff --git a/src/buffer.c b/src/buffer.c
index aa1770a..86f6ffc 100644
--- a/src/buffer.c
+++ b/src/buffer.c
@@ -880,6 +880,7 @@
/* b:changedtick uses an item in buf_T, remove it now */
dictitem_remove(buf->b_vars, (dictitem_T *)&buf->b_ct_di);
unref_var_dict(buf->b_vars);
+ remove_listeners(buf);
#endif
#ifdef FEAT_LUA
lua_buffer_free(buf);
@@ -908,6 +909,7 @@
#ifdef FEAT_JOB_CHANNEL
vim_free(buf->b_prompt_text);
free_callback(&buf->b_prompt_callback);
+ free_callback(&buf->b_prompt_interrupt);
#endif
buf_hashtab_remove(buf);