diff options
| author | Volodymyr Chernetskyi <volodymyr_chernetskyi@goodyear.com> | 2026-09-05 02:57:55 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-09-04 20:57:55 -0400 |
| commit | 48864161cd75ae4b58f7af94d6c9add0ba876107 (patch) | |
| tree | 357a165969bca4198afa43fa95981385d7bd68ce /runtime/lua/vim/_async.lua | |
| parent | 3a02a399578c9063807f8e327697095a1a5923ce (diff) | |
| download | rneovim-48864161cd75ae4b58f7af94d6c9add0ba876107.tar.gz rneovim-48864161cd75ae4b58f7af94d6c9add0ba876107.tar.bz2 rneovim-48864161cd75ae4b58f7af94d6c9add0ba876107.zip | |
fix(api): leaked error message in nvim_win_set_buf() #41688
Problem:
Both handle lookups write into the same `Error` before either one is
checked, and `api_set_error()` unconditionally `xmalloc`s `err->msg`
without freeing what is already there. When both handles are invalid,
the message allocated for the window is silently overwritten by the one
for the buffer and leaked.
Solution:
Check the window before looking up the buffer. As a side effect the
reported error no longer names the buffer when the window was wrong too.
AI-assisted
Diffstat (limited to 'runtime/lua/vim/_async.lua')
0 files changed, 0 insertions, 0 deletions