vim-patch:9.2.0055: memory leak in ExpandFromContext() (#38066)

Problem:  memory leak in ExpandFromContext()
Solution: Free the variable (Huihui Huang).

fixes:  vim/vim#19500
closes: vim/vim#19505

https://github.com/vim/vim/commit/9c3279ddc39da31f3fe9c52d06cb8a9b3a06ca0e

N/A patches:
vim-patch:9.2.0056: memory leak in ex_substitute
vim-patch:9.2.0057: memory leak in exe_newdict()
vim-patch:9.2.0058: Compile error in did_set_previewpopup()
vim-patch:9.2.0059: memory leak in fill_assert_error

Co-authored-by: Huihui Huang <625173@qq.com>
This commit is contained in:
zeertzjqandHuihui Huang authored and GitHub committed 2026-02-26 00:04:34 +00:00
1 parent 583308f599
commit 9288357d59
1 file changed
+1 -1
+1 -1
View File
@@ -3084,9 +3084,9 @@ static int ExpandFromContext(expand_T *xp, char *pat, char ***matches, int *numM
if (!fuzzy) {
regmatch.regprog = vim_regcomp(pat, magic_isset() ? RE_MAGIC : 0);
if (regmatch.regprog == NULL) {
xfree(tofree);
return FAIL;
}
// set ignore-case according to p_ic, p_scs and pat
regmatch.rm_ic = ignorecase(pat);
}