diff options
author | Bram Moolenaar <Bram@vim.org> | 2020-01-20 21:59:39 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2020-01-20 21:59:39 +0100 |
commit | 538feb56e87c647d9b1cc8522f7650d263096f63 (patch) | |
tree | 3af7e268ff5f40569b098789eaedfc93a27a854e /src/channel.c | |
parent | a44b3eeafa57d4904a3de86b132008b93404f0fd (diff) |
patch 8.2.0138: memory leak when starting a job failsv8.2.0138
Problem: Memory leak when starting a job fails.
Solution: Free the list of arguments. (Ozaki Kiichi, closes #5510)
Diffstat (limited to 'src/channel.c')
-rw-r--r-- | src/channel.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/channel.c b/src/channel.c index fc6a7a37bb..cd791b59b0 100644 --- a/src/channel.c +++ b/src/channel.c @@ -5818,9 +5818,9 @@ job_start( char_u *cmd = NULL; char **argv = NULL; int argc = 0; + int i; #if defined(UNIX) # define USE_ARGV - int i; #else garray_T ga; #endif @@ -5994,7 +5994,11 @@ theend: vim_free(ga.ga_data); #endif if (argv != job->jv_argv) + { + for (i = 0; argv[i] != NULL; i++) + vim_free(argv[i]); vim_free(argv); + } free_job_options(&opt); return job; } |