diff options
author | Bram Moolenaar <Bram@vim.org> | 2016-04-07 21:40:38 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2016-04-07 21:40:38 +0200 |
commit | 0e4c1de5560c7f8b4cae539ec8cff0949daba3fc (patch) | |
tree | f6daf3541d698b421905285e17ffdd8a6b33a051 /src/eval.c | |
parent | baec5c1768098f9dd867b465aaabfdfb294f10c2 (diff) | |
download | vim-0e4c1de5560c7f8b4cae539ec8cff0949daba3fc.zip |
patch 7.4.1717
Problem: Leaking memory when opening a channel fails.
Solution: Unreference partials in job options.
Diffstat (limited to 'src/eval.c')
-rw-r--r-- | src/eval.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/eval.c b/src/eval.c index e7fbeaa55..b4e716687 100644 --- a/src/eval.c +++ b/src/eval.c @@ -10321,9 +10321,9 @@ f_ch_setoptions(typval_T *argvars, typval_T *rettv UNUSED) return; clear_job_options(&opt); if (get_job_options(&argvars[1], &opt, - JO_CB_ALL + JO_TIMEOUT_ALL + JO_MODE_ALL) == FAIL) - return; - channel_set_options(channel, &opt); + JO_CB_ALL + JO_TIMEOUT_ALL + JO_MODE_ALL) == OK) + channel_set_options(channel, &opt); + free_job_options(&opt); } /* @@ -14889,9 +14889,9 @@ f_job_setoptions(typval_T *argvars, typval_T *rettv UNUSED) if (job == NULL) return; clear_job_options(&opt); - if (get_job_options(&argvars[1], &opt, JO_STOPONEXIT + JO_EXIT_CB) == FAIL) - return; - job_set_options(job, &opt); + if (get_job_options(&argvars[1], &opt, JO_STOPONEXIT + JO_EXIT_CB) == OK) + job_set_options(job, &opt); + free_job_options(&opt); } /* |