mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
Merge pull request #1534 from oni-link/fix.leak.detected.in.1510
Fix memory leak detected in #1510.
This commit is contained in:
commit
930e58c56d
@ -241,6 +241,7 @@ Object channel_send_call(uint64_t id,
|
||||
|
||||
if (frame.errored) {
|
||||
api_set_error(err, Exception, "%s", frame.result.data.string.data);
|
||||
api_free_object(frame.result);
|
||||
return NIL;
|
||||
}
|
||||
|
||||
@ -347,7 +348,13 @@ static void job_err(RStream *rstream, void *data, bool eof)
|
||||
|
||||
static void job_exit(Job *job, void *data)
|
||||
{
|
||||
free_channel((Channel *)data);
|
||||
Channel *channel = data;
|
||||
// ensure the channel is flagged as closed so channel_send_call frees it
|
||||
// later
|
||||
channel->closed = true;
|
||||
if (!kv_size(channel->call_stack)) {
|
||||
free_channel(channel);
|
||||
}
|
||||
}
|
||||
|
||||
static void parse_msgpack(RStream *rstream, void *data, bool eof)
|
||||
|
Loading…
Reference in New Issue
Block a user