mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
vim-patch:9.1.0195: memleak with ex_drop, NULL dereference
Problem: memleak with ex_drop(), NULL dereference
(zeertzjq)
Solution: revert back to ex_rewind(), use curbuf instead of buf
fixes: vim/vim#14246
closes: vim/vim#14251
85a769d466
Co-authored-by: Christian Brabandt <cb@256bit.org>
This commit is contained in:
parent
271879dd49
commit
dabc44d15c
@ -866,12 +866,12 @@ void ex_drop(exarg_T *eap)
|
||||
const int save_ar = curbuf->b_p_ar;
|
||||
|
||||
// reload the file if it is newer
|
||||
curbuf->b_p_ar = 1;
|
||||
curbuf->b_p_ar = true;
|
||||
buf_check_timestamp(curbuf);
|
||||
curbuf->b_p_ar = save_ar;
|
||||
}
|
||||
if (buf->b_ml.ml_flags & ML_EMPTY) {
|
||||
open_buffer(false, eap, 0);
|
||||
if (curbuf->b_ml.ml_flags & ML_EMPTY) {
|
||||
ex_rewind(eap);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
@ -72,7 +72,7 @@ describe(':drop', function()
|
||||
lazy dogs |
|
||||
{0:~ }|*6
|
||||
{1:Xdrop_modified.txt [+] }|
|
||||
"Xdrop_modified.txt" [New] |
|
||||
:drop Xdrop_modified.txt |
|
||||
]])
|
||||
end)
|
||||
end)
|
||||
|
Loading…
Reference in New Issue
Block a user