diff options
| author | zeertzjq <zeertzjq@outlook.com> | 2022-12-20 05:24:03 +0800 |
|---|---|---|
| committer | zeertzjq <zeertzjq@outlook.com> | 2022-12-20 05:26:52 +0800 |
| commit | ff62d761938e72129f6ba7ed2c2d56455444ebe7 (patch) | |
| tree | fb612132b6d4f257d4ada5abe5c2db331c38b6e4 /src/nvim/testdir | |
| parent | b201cbfc61916a831d4a36f58284a5c1a3e006e1 (diff) | |
| download | rneovim-ff62d761938e72129f6ba7ed2c2d56455444ebe7.tar.gz rneovim-ff62d761938e72129f6ba7ed2c2d56455444ebe7.tar.bz2 rneovim-ff62d761938e72129f6ba7ed2c2d56455444ebe7.zip | |
vim-patch:9.0.1079: leaking memory when defining a user command fails
Problem: Leaking memory when defining a user command fails.
Solution: Free "compl_arg" when needed. (closes vim/vim#11726)
https://github.com/vim/vim/commit/33e543038b84af7557ab9ecff500fc4ab98dd2a3
Diffstat (limited to 'src/nvim/testdir')
| -rw-r--r-- | src/nvim/testdir/test_usercommands.vim | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/nvim/testdir/test_usercommands.vim b/src/nvim/testdir/test_usercommands.vim index 6a985d78aa..3ae990e022 100644 --- a/src/nvim/testdir/test_usercommands.vim +++ b/src/nvim/testdir/test_usercommands.vim @@ -323,6 +323,11 @@ func Test_CmdErrors() call assert_fails('com DoCmd :', 'E174:') comclear call assert_fails('delcom DoCmd', 'E184:') + + " These used to leak memory + call assert_fails('com! -complete=custom,CustomComplete _ :', 'E182:') + call assert_fails('com! -complete=custom,CustomComplete docmd :', 'E183:') + call assert_fails('com! -complete=custom,CustomComplete -xxx DoCmd :', 'E181:') endfunc func CustomComplete(A, L, P) |