vim-patch:8.2.4182: memory leak when evaluating 'diffexpr'

Problem:    Memory leak when evaluating 'diffexpr'.
Solution:   Use free_tv() instead of clear_tv().

39b8944539

Co-authored-by: Bram Moolenaar <Bram@vim.org>
This commit is contained in:
zeertzjq
2023-04-17 15:21:03 +08:00
parent ba57566601
commit 9cf59acfaa

View File

@@ -681,7 +681,7 @@ void eval_diff(const char *const origfile, const char *const newfile, const char
// errors are ignored // errors are ignored
typval_T *tv = eval_expr(p_dex, NULL); typval_T *tv = eval_expr(p_dex, NULL);
tv_clear(tv); tv_free(tv);
set_vim_var_string(VV_FNAME_IN, NULL, -1); set_vim_var_string(VV_FNAME_IN, NULL, -1);
set_vim_var_string(VV_FNAME_NEW, NULL, -1); set_vim_var_string(VV_FNAME_NEW, NULL, -1);