diff options
author | Thiago de Arruda <tpadilha84@gmail.com> | 2014-09-09 15:32:41 -0300 |
---|---|---|
committer | Thiago de Arruda <tpadilha84@gmail.com> | 2014-09-12 13:25:28 -0300 |
commit | 3f15d34056fa5f8bc4d97efffc3f239aa68395d0 (patch) | |
tree | b0eee70a6742c4ce3f40dae7d883f088dd964428 | |
parent | 551b76c516dee88ccdab49d3bbc2cccc7dfcb0cc (diff) | |
download | rneovim-3f15d34056fa5f8bc4d97efffc3f239aa68395d0.tar.gz rneovim-3f15d34056fa5f8bc4d97efffc3f239aa68395d0.tar.bz2 rneovim-3f15d34056fa5f8bc4d97efffc3f239aa68395d0.zip |
job: Fix crash when passing a non-executable path to job_start
-rw-r--r-- | src/nvim/os/job.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/nvim/os/job.c b/src/nvim/os/job.c index 9deca9de74..9fb2a49e50 100644 --- a/src/nvim/os/job.c +++ b/src/nvim/os/job.c @@ -197,6 +197,12 @@ Job *job_start(char **argv, job->stdio[2].flags = UV_CREATE_PIPE | UV_WRITABLE_PIPE; job->stdio[2].data.stream = (uv_stream_t *)&job->proc_stderr; + // Give all handles a reference to the job + handle_set_job((uv_handle_t *)&job->proc, job); + handle_set_job((uv_handle_t *)&job->proc_stdin, job); + handle_set_job((uv_handle_t *)&job->proc_stdout, job); + handle_set_job((uv_handle_t *)&job->proc_stderr, job); + // Spawn the job if (uv_spawn(uv_default_loop(), &job->proc, &job->proc_opts) != 0) { free_job(job); @@ -204,12 +210,6 @@ Job *job_start(char **argv, return NULL; } - // Give all handles a reference to the job - handle_set_job((uv_handle_t *)&job->proc, job); - handle_set_job((uv_handle_t *)&job->proc_stdin, job); - handle_set_job((uv_handle_t *)&job->proc_stdout, job); - handle_set_job((uv_handle_t *)&job->proc_stderr, job); - job->in = wstream_new(maxmem); wstream_set_stream(job->in, (uv_stream_t *)&job->proc_stdin); // Start the readable streams |