mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06: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:
parent
e491e77498
commit
608c03298a
@ -2001,7 +2001,9 @@ static void didset_options2(void)
|
||||
|
||||
// Parse default for 'wildmode'.
|
||||
check_opt_wim();
|
||||
xfree(curbuf->b_p_vsts_array);
|
||||
tabstop_set(curbuf->b_p_vsts, &curbuf->b_p_vsts_array);
|
||||
xfree(curbuf->b_p_vts_array);
|
||||
tabstop_set(curbuf->b_p_vts, &curbuf->b_p_vts_array);
|
||||
}
|
||||
|
||||
@ -3167,9 +3169,7 @@ ambw_end:
|
||||
if (errmsg == NULL) {
|
||||
long *oldarray = curbuf->b_p_vts_array;
|
||||
if (tabstop_set(*varp, &(curbuf->b_p_vts_array))) {
|
||||
if (oldarray) {
|
||||
xfree(oldarray);
|
||||
}
|
||||
xfree(oldarray);
|
||||
if (foldmethodIsIndent(curwin)) {
|
||||
foldUpdateAll(curwin);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user