mirror of
https://github.com/neovim/neovim.git
synced 2025-09-16 00:08:19 +00:00
vim-patch:8.1.0936: may leak memory when using 'vartabstop'
Problem: May leak memory when using 'vartabstop'. (Kuang-che Wu)
Solution: Fix handling allocated memory for 'vartabstop'. (closes vim/vim#3976)
55c77cf2ea
This commit is contained in:
@@ -1956,10 +1956,7 @@ void free_buf_options(buf_T *buf, int free_p_ff)
|
|||||||
}
|
}
|
||||||
buf->b_p_vsts_array = NULL;
|
buf->b_p_vsts_array = NULL;
|
||||||
clear_string_option(&buf->b_p_vts);
|
clear_string_option(&buf->b_p_vts);
|
||||||
if (buf->b_p_vts_array) {
|
XFREE_CLEAR(buf->b_p_vts_array);
|
||||||
xfree(buf->b_p_vts_array);
|
|
||||||
}
|
|
||||||
buf->b_p_vts_array = NULL;
|
|
||||||
clear_string_option(&buf->b_p_keymap);
|
clear_string_option(&buf->b_p_keymap);
|
||||||
keymap_ga_clear(&buf->b_kmap_ga);
|
keymap_ga_clear(&buf->b_kmap_ga);
|
||||||
ga_clear(&buf->b_kmap_ga);
|
ga_clear(&buf->b_kmap_ga);
|
||||||
|
@@ -3139,9 +3139,7 @@ ambw_end:
|
|||||||
if (errmsg == NULL) {
|
if (errmsg == NULL) {
|
||||||
long *oldarray = curbuf->b_p_vsts_array;
|
long *oldarray = curbuf->b_p_vsts_array;
|
||||||
if (tabstop_set(*varp, &(curbuf->b_p_vsts_array))) {
|
if (tabstop_set(*varp, &(curbuf->b_p_vsts_array))) {
|
||||||
if (oldarray) {
|
|
||||||
xfree(oldarray);
|
xfree(oldarray);
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
errmsg = e_invarg;
|
errmsg = e_invarg;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user