mirror of
https://github.com/neovim/neovim.git
synced 2025-12-10 08:32:42 +00:00
job: Close libuv handles when uv_spawn fails
Commit @709685b4612f4 removed the close_job_* calls when uv_spawn fails because
of memory errors when trying to cleanup unitialized {R,W}Stream instances, but
the uv_pipe_t instances must be closed because they are added to the event loop
queue by previous `uv_pipe_init()` calls
This commit is contained in:
@@ -215,6 +215,10 @@ Job *job_start(char **argv,
|
||||
|
||||
// Spawn the job
|
||||
if (uv_spawn(uv_default_loop(), &job->proc, &job->proc_opts) != 0) {
|
||||
uv_close((uv_handle_t *)&job->proc_stdin, NULL);
|
||||
uv_close((uv_handle_t *)&job->proc_stdout, NULL);
|
||||
uv_close((uv_handle_t *)&job->proc_stderr, NULL);
|
||||
event_poll(0);
|
||||
*status = -1;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user