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:
oni-link
2015-02-12 14:07:05 +01:00
committed by Thiago de Arruda
parent db3ae72d19
commit 12b084b621
2 changed files with 4 additions and 3 deletions

View File

@@ -495,6 +495,7 @@ static bool channel_write(Channel *channel, WBuffer *buffer)
bool success;
if (channel->closed) {
wstream_release_wbuffer(buffer);
return false;
}