Mercurial > vim
comparison src/testdir/test_functions.vim @ 24448:faac16c365b6 v8.2.2764
patch 8.2.2764: memory leak when default function argument is allocated
Commit: https://github.com/vim/vim/commit/b47bed2f7ada4dfae78f76f27473b83507e40315
Author: Bram Moolenaar <Bram@vim.org>
Date: Wed Apr 14 17:06:43 2021 +0200
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.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Wed, 14 Apr 2021 17:15:05 +0200 |
parents | ec71c859e94c |
children | acd9220bdd0b |
comparison
equal
deleted
inserted
replaced
24447:bbe84a902d14 | 24448:faac16c365b6 |
---|---|
1495 call assert_fails('call inputlist(test_null_list())', 'E686:') | 1495 call assert_fails('call inputlist(test_null_list())', 'E686:') |
1496 endfunc | 1496 endfunc |
1497 | 1497 |
1498 func Test_balloon_show() | 1498 func Test_balloon_show() |
1499 CheckFeature balloon_eval | 1499 CheckFeature balloon_eval |
1500 | |
1500 " This won't do anything but must not crash either. | 1501 " This won't do anything but must not crash either. |
1501 call balloon_show('hi!') | 1502 call balloon_show('hi!') |
1502 if !has('gui_running') | 1503 if !has('gui_running') |
1503 call balloon_show(range(3)) | 1504 call balloon_show(range(3)) |
1504 call balloon_show([]) | 1505 call balloon_show([]) |
2648 func Test_browsedir() | 2649 func Test_browsedir() |
2649 CheckFeature browse | 2650 CheckFeature browse |
2650 call assert_fails('call browsedir("open", [])', 'E730:') | 2651 call assert_fails('call browsedir("open", [])', 'E730:') |
2651 endfunc | 2652 endfunc |
2652 | 2653 |
2654 func HasDefault(msg = 'msg') | |
2655 return a:msg | |
2656 endfunc | |
2657 | |
2658 func Test_default_arg_value() | |
2659 call assert_equal('msg', HasDefault()) | |
2660 endfunc | |
2661 | |
2653 " vim: shiftwidth=2 sts=2 expandtab | 2662 " vim: shiftwidth=2 sts=2 expandtab |