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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user