patch 8.1.2107: various memory leaks reported by asan
Problem: Various memory leaks reported by asan.
Solution: Free the memory. (Ozaki Kiichi, closes #5003)
diff --git a/src/testdir/test_method.vim b/src/testdir/test_method.vim
index 69adc30..b82dbb4 100644
--- a/src/testdir/test_method.vim
+++ b/src/testdir/test_method.vim
@@ -140,6 +140,10 @@
" todo: lambda accepts more arguments than it consumes
" call assert_fails('eval "text"->{x -> x .. " extended"}("more")', 'E99:')
+
+ let l = [1, 2, 3]
+ eval l->{x -> x}()
+ call assert_equal(1, test_refcount(l))
endfunc
func Test_method_not_supported()