mirror of
https://github.com/neovim/neovim.git
synced 2025-10-09 19:36:40 +00:00
vim-patch:8.2.2764: memory leak when default function argument is allocated
Problem: Memory leak when default function argument is allocated.
Solution: Free the expression result.
b47bed2f7a
This commit is contained in:
@@ -1071,10 +1071,10 @@ func Test_inputlist()
|
||||
endfunc
|
||||
|
||||
func Test_balloon_show()
|
||||
if has('balloon_eval')
|
||||
" This won't do anything but must not crash either.
|
||||
call balloon_show('hi!')
|
||||
endif
|
||||
CheckFeature balloon_eval
|
||||
|
||||
" This won't do anything but must not crash either.
|
||||
call balloon_show('hi!')
|
||||
endfunc
|
||||
|
||||
func Test_shellescape()
|
||||
@@ -1448,4 +1448,12 @@ func Test_nr2char()
|
||||
call assert_equal("\x80\xfc\b\xfd\x80\xfeX\x80\xfeX\x80\xfeX\x80\xfeX\x80\xfeX", eval('"\<M-' .. nr2char(0x40000000) .. '>"'))
|
||||
endfunc
|
||||
|
||||
func HasDefault(msg = 'msg')
|
||||
return a:msg
|
||||
endfunc
|
||||
|
||||
func Test_default_arg_value()
|
||||
call assert_equal('msg', HasDefault())
|
||||
endfunc
|
||||
|
||||
" vim: shiftwidth=2 sts=2 expandtab
|
||||
|
Reference in New Issue
Block a user