Mercurial > vim
comparison src/eval.c @ 8859:03250bc0c63a v7.4.1717
commit https://github.com/vim/vim/commit/0e4c1de5560c7f8b4cae539ec8cff0949daba3fc
Author: Bram Moolenaar <Bram@vim.org>
Date: Thu Apr 7 21:40:38 2016 +0200
patch 7.4.1717
Problem: Leaking memory when opening a channel fails.
Solution: Unreference partials in job options.
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Thu, 07 Apr 2016 21:45:05 +0200 |
parents | b76195a1e38e |
children | 45fe799c9672 |
comparison
equal
deleted
inserted
replaced
8858:593b17f02b78 | 8859:03250bc0c63a |
---|---|
10319 channel = get_channel_arg(&argvars[0], TRUE); | 10319 channel = get_channel_arg(&argvars[0], TRUE); |
10320 if (channel == NULL) | 10320 if (channel == NULL) |
10321 return; | 10321 return; |
10322 clear_job_options(&opt); | 10322 clear_job_options(&opt); |
10323 if (get_job_options(&argvars[1], &opt, | 10323 if (get_job_options(&argvars[1], &opt, |
10324 JO_CB_ALL + JO_TIMEOUT_ALL + JO_MODE_ALL) == FAIL) | 10324 JO_CB_ALL + JO_TIMEOUT_ALL + JO_MODE_ALL) == OK) |
10325 return; | 10325 channel_set_options(channel, &opt); |
10326 channel_set_options(channel, &opt); | 10326 free_job_options(&opt); |
10327 } | 10327 } |
10328 | 10328 |
10329 /* | 10329 /* |
10330 * "ch_status()" function | 10330 * "ch_status()" function |
10331 */ | 10331 */ |
14887 jobopt_T opt; | 14887 jobopt_T opt; |
14888 | 14888 |
14889 if (job == NULL) | 14889 if (job == NULL) |
14890 return; | 14890 return; |
14891 clear_job_options(&opt); | 14891 clear_job_options(&opt); |
14892 if (get_job_options(&argvars[1], &opt, JO_STOPONEXIT + JO_EXIT_CB) == FAIL) | 14892 if (get_job_options(&argvars[1], &opt, JO_STOPONEXIT + JO_EXIT_CB) == OK) |
14893 return; | 14893 job_set_options(job, &opt); |
14894 job_set_options(job, &opt); | 14894 free_job_options(&opt); |
14895 } | 14895 } |
14896 | 14896 |
14897 /* | 14897 /* |
14898 * "job_start()" function | 14898 * "job_start()" function |
14899 */ | 14899 */ |