mirror of
https://github.com/neovim/neovim.git
synced 2025-09-13 06:48:17 +00:00
Merge pull request #1534 from oni-link/fix.leak.detected.in.1510
Fix memory leak detected in #1510.
This commit is contained in:
@@ -241,6 +241,7 @@ Object channel_send_call(uint64_t id,
|
|||||||
|
|
||||||
if (frame.errored) {
|
if (frame.errored) {
|
||||||
api_set_error(err, Exception, "%s", frame.result.data.string.data);
|
api_set_error(err, Exception, "%s", frame.result.data.string.data);
|
||||||
|
api_free_object(frame.result);
|
||||||
return NIL;
|
return NIL;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -347,7 +348,13 @@ static void job_err(RStream *rstream, void *data, bool eof)
|
|||||||
|
|
||||||
static void job_exit(Job *job, void *data)
|
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)
|
static void parse_msgpack(RStream *rstream, void *data, bool eof)
|
||||||
|
Reference in New Issue
Block a user