diff options
author | Mathias Fußenegger <mfussenegger@users.noreply.github.com> | 2022-08-11 17:04:55 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-08-11 17:04:55 +0200 |
commit | 996fc2256bafabeb8f5806d70d531311a34d29f9 (patch) | |
tree | 82b14c237a066819ced58ea7aa9acb3f37be3aea /runtime/lua/vim/lsp/rpc.lua | |
parent | 8b67f37798d90da957801be791da9425fb6fe741 (diff) | |
download | rneovim-996fc2256bafabeb8f5806d70d531311a34d29f9.tar.gz rneovim-996fc2256bafabeb8f5806d70d531311a34d29f9.tar.bz2 rneovim-996fc2256bafabeb8f5806d70d531311a34d29f9.zip |
fix(lsp): avoid pipe leaks if lsp cmd isn't executable (#19717)
The `onexit` handler isn't called if `uv.spawn` doesn't return a handle.
Diffstat (limited to 'runtime/lua/vim/lsp/rpc.lua')
-rw-r--r-- | runtime/lua/vim/lsp/rpc.lua | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/runtime/lua/vim/lsp/rpc.lua b/runtime/lua/vim/lsp/rpc.lua index 3d61dd5e33..0926912066 100644 --- a/runtime/lua/vim/lsp/rpc.lua +++ b/runtime/lua/vim/lsp/rpc.lua @@ -340,6 +340,9 @@ local function start(cmd, cmd_args, dispatchers, extra_spawn_params) end handle, pid = uv.spawn(cmd, spawn_params, onexit) if handle == nil then + stdin:close() + stdout:close() + stderr:close() local msg = string.format('Spawning language server with cmd: `%s` failed', cmd) if string.match(pid, 'ENOENT') then msg = msg |