aboutsummaryrefslogtreecommitdiff
path: root/runtime/lua/vim/lsp/rpc.lua
diff options
context:
space:
mode:
authorMathias Fußenegger <mfussenegger@users.noreply.github.com>2022-08-11 17:04:55 +0200
committerGitHub <noreply@github.com>2022-08-11 17:04:55 +0200
commit996fc2256bafabeb8f5806d70d531311a34d29f9 (patch)
tree82b14c237a066819ced58ea7aa9acb3f37be3aea /runtime/lua/vim/lsp/rpc.lua
parent8b67f37798d90da957801be791da9425fb6fe741 (diff)
downloadrneovim-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.lua3
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