aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/nvim/msgpack_rpc/channel.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/src/nvim/msgpack_rpc/channel.c b/src/nvim/msgpack_rpc/channel.c
index 3622c8252d..7b51eefa3a 100644
--- a/src/nvim/msgpack_rpc/channel.c
+++ b/src/nvim/msgpack_rpc/channel.c
@@ -455,14 +455,12 @@ static void call_request_handler(Channel *channel,
// send the response
msgpack_packer response;
msgpack_packer_init(&response, &out_buffer, msgpack_sbuffer_write);
-
- if (error.set) {
- channel_write(channel,
- serialize_response(request_id, &error, NIL, &out_buffer));
- }
-
- channel_write(channel,
- serialize_response(request_id, &error, result, &out_buffer));
+ channel_write(channel, serialize_response(request_id,
+ &error,
+ result,
+ &out_buffer));
+ // All arguments were freed already, but we still need to free the array
+ free(args.items);
}
static bool channel_write(Channel *channel, WBuffer *buffer)