Files
neovim/test/functional
Volodymyr Chernetskyi 48864161cd 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
2026-09-04 20:57:55 -04:00
..
2026-09-01 15:17:22 +00:00