vim-patch:9.1.1649: attrs allocation and fuzzy growarray could leak (#35383)

Problem:  attrs allocation and fuzzy growarray could leak on early
          returns
Solution: Ensure proper cleanup of allocated memory on exit paths
          (glepnir)

closes: vim/vim#18038

c7c10f8c11

Co-authored-by: glepnir <glephunter@gmail.com>
This commit is contained in:
zeertzjq
2025-08-19 08:45:15 +08:00
committed by GitHub
parent 1e20f31aa3
commit 25bc41847e

View File

@@ -460,6 +460,10 @@ static int *pum_compute_text_attrs(char *text, hlf_T hlf, int user_hlattr)
if (in_fuzzy) {
ga = fuzzy_match_str_with_pos(text, leader);
if (!ga) {
xfree(attrs);
return NULL;
}
}
const char *ptr = text;