1
0
forked from aniani/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 #11726)
This commit is contained in:
zeertzjq
2022-12-19 16:49:27 +00:00
committed by Bram Moolenaar
parent 07146ad1d3
commit 33e543038b
3 changed files with 20 additions and 2 deletions

View File

@@ -342,6 +342,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)