From fe94e04893274b9c5697fb179eb6b00bc1cd3a91 Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Fri, 24 Nov 2023 06:52:50 +0800 Subject: vim-patch:9.0.2126: unused assignments when checking 'listchars' (#26182) Problem: Unused assignments when checking the value of 'listchars'. Solution: Loop only once when just checking the value. Add a test to check that this change doesn't cause double-free. closes: vim/vim#13559 https://github.com/vim/vim/commit/00624a2fa08d04bdded240d474e9cfdc193dbe10 --- src/nvim/optionstr.c | 3 --- 1 file changed, 3 deletions(-) (limited to 'src') diff --git a/src/nvim/optionstr.c b/src/nvim/optionstr.c index 56f44788b0..6c6fac84bf 100644 --- a/src/nvim/optionstr.c +++ b/src/nvim/optionstr.c @@ -2871,9 +2871,6 @@ static const char *set_chars_option(win_T *wp, const char *value, const bool is_ } else { wp->w_p_fcs_chars = fcs_chars; } - } else if (is_listchars) { - xfree(lcs_chars.multispace); - xfree(lcs_chars.leadmultispace); } return NULL; // no error -- cgit