mirror of
https://github.com/neovim/neovim.git
synced 2025-10-02 16:08:36 +00:00
api: fix leak when a api function is incorrectly called with a list.
This applies both to msgpack-rpc and eval.
This commit is contained in:
@@ -7140,8 +7140,7 @@ static void api_wrapper(typval_T *argvars, typval_T *rettv, FunPtr fptr)
|
||||
}
|
||||
|
||||
end:
|
||||
// All arguments were freed already, but we still need to free the array
|
||||
xfree(args.items);
|
||||
api_free_array(args);
|
||||
api_free_object(result);
|
||||
}
|
||||
|
||||
|
@@ -465,8 +465,7 @@ static void on_request_event(void **argv)
|
||||
} else {
|
||||
api_free_object(result);
|
||||
}
|
||||
// All arguments were freed already, but we still need to free the array
|
||||
xfree(args.items);
|
||||
api_free_array(args);
|
||||
decref(channel);
|
||||
xfree(e);
|
||||
}
|
||||
|
Reference in New Issue
Block a user