diff options
author | Bram Moolenaar <Bram@vim.org> | 2022-06-12 11:49:16 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2022-06-12 11:49:16 +0100 |
commit | d8c9d32c8932e93008bfd4e8828ed42f4e9f8315 (patch) | |
tree | b70a3c3bc8e95ff3e27696e02675baf2301e17f4 /src/testdir/test_autocmd.vim | |
parent | 3269efdf014dd3b6e60e330950d40a7cc5d13d3a (diff) | |
download | vim-git-d8c9d32c8932e93008bfd4e8828ed42f4e9f8315.tar.gz |
patch 8.2.5079: DirChanged autocommand may use freed memoryv8.2.5079
Problem: DirChanged autocommand may use freed memory. (Shane-XB Qian)
Solution: Free the memory later. (closes #10555)
Diffstat (limited to 'src/testdir/test_autocmd.vim')
-rw-r--r-- | src/testdir/test_autocmd.vim | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/testdir/test_autocmd.vim b/src/testdir/test_autocmd.vim index 24e2ed984..15aab48a6 100644 --- a/src/testdir/test_autocmd.vim +++ b/src/testdir/test_autocmd.vim @@ -2107,6 +2107,13 @@ function Test_dirchanged_global() call assert_equal(expected, s:li) exe 'lcd ' .. fnameescape(s:dir_bar) call assert_equal(expected, s:li) + + exe 'cd ' .. s:dir_foo + exe 'cd ' .. s:dir_bar + autocmd! test_dirchanged DirChanged global let g:result = expand("<afile>") + cd - + call assert_equal(s:dir_foo, g:result) + call s:After_test_dirchanged() endfunc |