aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/msgpack_rpc
diff options
context:
space:
mode:
authoroni-link <knil.ino@gmail.com>2015-02-12 14:07:05 +0100
committerThiago de Arruda <tpadilha84@gmail.com>2015-04-03 08:03:25 -0300
commit12b084b62109e6dc43792fc4af5accb21b469d05 (patch)
tree4639b0a2622f956a5f37917a3a4457fc0f87859a /src/nvim/msgpack_rpc
parentdb3ae72d1952cd93d5736c3ffd35eedcce0b5488 (diff)
downloadrneovim-12b084b62109e6dc43792fc4af5accb21b469d05.tar.gz
rneovim-12b084b62109e6dc43792fc4af5accb21b469d05.tar.bz2
rneovim-12b084b62109e6dc43792fc4af5accb21b469d05.zip
Fix a memory leak for WBuffers used in channel_write().
channel_write() uses a ref-counted buffer for writing. This buffer should be released if it was used in "refcount" channel_write() calls. But calling channel_write() on a closed channel would return early and not decrease the refcount of the used buffer.
Diffstat (limited to 'src/nvim/msgpack_rpc')
-rw-r--r--src/nvim/msgpack_rpc/channel.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/nvim/msgpack_rpc/channel.c b/src/nvim/msgpack_rpc/channel.c
index ab67500fdc..35549ce042 100644
--- a/src/nvim/msgpack_rpc/channel.c
+++ b/src/nvim/msgpack_rpc/channel.c
@@ -495,6 +495,7 @@ static bool channel_write(Channel *channel, WBuffer *buffer)
bool success;
if (channel->closed) {
+ wstream_release_wbuffer(buffer);
return false;
}