diff options
Diffstat (limited to 'src/nvim/os')
-rw-r--r-- | src/nvim/os/job.c | 4 | ||||
-rw-r--r-- | src/nvim/os/wstream.c | 6 |
2 files changed, 8 insertions, 2 deletions
diff --git a/src/nvim/os/job.c b/src/nvim/os/job.c index 7ae2a86fc2..17872ab9c9 100644 --- a/src/nvim/os/job.c +++ b/src/nvim/os/job.c @@ -105,7 +105,8 @@ void job_teardown(void) /// Tries to start a new job. /// /// @param argv Argument vector for the process. The first item is the -/// executable to run. +/// executable to run. +/// [consumed] /// @param data Caller data that will be associated with the job /// @param writable If true the job stdin will be available for writing with /// job_write, otherwise it will be redirected to /dev/null @@ -139,6 +140,7 @@ Job *job_start(char **argv, if (i == MAX_RUNNING_JOBS) { // No free slots + shell_free_argv(argv); *status = 0; return NULL; } diff --git a/src/nvim/os/wstream.c b/src/nvim/os/wstream.c index a1f3612418..6a650ce775 100644 --- a/src/nvim/os/wstream.c +++ b/src/nvim/os/wstream.c @@ -230,7 +230,11 @@ static void write_cb(uv_write_t *req, int status) if (data->wstream->freed && data->wstream->pending_reqs == 0) { // Last pending write, free the wstream; - free(data->wstream); + if (data->wstream->free_handle) { + uv_close((uv_handle_t *)data->wstream->stream, close_cb); + } else { + free(data->wstream); + } } kmp_free(WRequestPool, wrequest_pool, data); |