mirror of
https://github.com/neovim/neovim.git
synced 2025-09-19 01:38:16 +00:00
api/window: Fix memory leak in nvim_win_set_cursor
This commit is contained in:
@@ -62,6 +62,10 @@ void nvim_win_set_cursor(Window window, ArrayOf(Integer, 2) pos, Error *err)
|
||||
{
|
||||
win_T *win = find_window_by_handle(window, err);
|
||||
|
||||
if (!win) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (pos.size != 2 || pos.items[0].type != kObjectTypeInteger
|
||||
|| pos.items[1].type != kObjectTypeInteger) {
|
||||
api_set_error(err,
|
||||
@@ -70,10 +74,6 @@ void nvim_win_set_cursor(Window window, ArrayOf(Integer, 2) pos, Error *err)
|
||||
return;
|
||||
}
|
||||
|
||||
if (!win) {
|
||||
return;
|
||||
}
|
||||
|
||||
int64_t row = pos.items[0].data.integer;
|
||||
int64_t col = pos.items[1].data.integer;
|
||||
|
||||
|
Reference in New Issue
Block a user