# HG changeset patch # User Christian Brabandt # Date 1469913305 -7200 # Node ID b74515b8f3d4c89f2b2fadd5592ba8fd842e2f9a # Parent d98b423c75cd67d2f569c6531cdcdc0cd2d0d20a commit https://github.com/vim/vim/commit/57e69ff2cca9edee3546373d04e0dde6810309e5 Author: Bram Moolenaar Date: Sat Jul 30 23:05:09 2016 +0200 patch 7.4.2131 Problem: More memory leaks when using partial, e.g. for "exit-cb". Solution: Don't copy the callback when using a partial. diff --git a/src/channel.c b/src/channel.c --- a/src/channel.c +++ b/src/channel.c @@ -1272,10 +1272,14 @@ channel_set_req_callback( if (item != NULL) { - item->cq_callback = vim_strsave(callback); item->cq_partial = partial; if (partial != NULL) + { ++partial->pt_refcount; + item->cq_callback = callback; + } + else + item->cq_callback = vim_strsave(callback); item->cq_seq_nr = id; item->cq_prev = head->cq_prev; head->cq_prev = item; @@ -4465,10 +4469,14 @@ job_set_options(job_T *job, jobopt_T *op } else { - job->jv_exit_cb = vim_strsave(opt->jo_exit_cb); job->jv_exit_partial = opt->jo_exit_partial; if (job->jv_exit_partial != NULL) + { + job->jv_exit_cb = opt->jo_exit_cb; ++job->jv_exit_partial->pt_refcount; + } + else + job->jv_exit_cb = vim_strsave(opt->jo_exit_cb); } } } diff --git a/src/version.c b/src/version.c --- a/src/version.c +++ b/src/version.c @@ -764,6 +764,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 2131, +/**/ 2130, /**/ 2129,