mirror of
https://github.com/neovim/neovim.git
synced 2026-09-09 07:25:51 +00:00
fix(fuzzy): fuzmatch_str_free() frees the wrong element #41691
Problem: The loop frees `fuzmatch[count].str` on every iteration instead of `fuzmatch[i].str`. The function has no callers in Nvim, so there is no impact today. The indexing is a slip from the port; Vim's implementation is correct. Solution: Index with the loop variable, as Vim does. AI-assisted
This commit is contained in:
committed by
GitHub
parent
efd1b66401
commit
6112d4a674
@@ -700,7 +700,7 @@ void fuzmatch_str_free(fuzmatch_str_T *const fuzmatch, int count)
|
||||
return;
|
||||
}
|
||||
for (int i = 0; i < count; i++) {
|
||||
xfree(fuzmatch[count].str);
|
||||
xfree(fuzmatch[i].str);
|
||||
}
|
||||
xfree(fuzmatch);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user