mirror of
https://github.com/neovim/neovim.git
synced 2025-10-09 03:16:31 +00:00
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.
This commit is contained in:

committed by
Thiago de Arruda

parent
db3ae72d19
commit
12b084b621
@@ -495,6 +495,7 @@ static bool channel_write(Channel *channel, WBuffer *buffer)
|
||||
bool success;
|
||||
|
||||
if (channel->closed) {
|
||||
wstream_release_wbuffer(buffer);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user