mirror of
https://github.com/neovim/neovim.git
synced 2025-09-05 19:08:15 +00:00
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:
@@ -460,6 +460,10 @@ static int *pum_compute_text_attrs(char *text, hlf_T hlf, int user_hlattr)
|
|||||||
|
|
||||||
if (in_fuzzy) {
|
if (in_fuzzy) {
|
||||||
ga = fuzzy_match_str_with_pos(text, leader);
|
ga = fuzzy_match_str_with_pos(text, leader);
|
||||||
|
if (!ga) {
|
||||||
|
xfree(attrs);
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const char *ptr = text;
|
const char *ptr = text;
|
||||||
|
Reference in New Issue
Block a user