win: fix buffer leak when using non-zero tcp reads

This commit is contained in:
Bert Belder 2011-08-19 17:18:14 +02:00
parent beaa676184
commit 062af9fea8

View File

@ -627,8 +627,8 @@ void uv_process_tcp_read_req(uv_tcp_t* handle, uv_req_t* req) {
if ((handle->flags & UV_HANDLE_READING)) {
handle->flags &= ~UV_HANDLE_READING;
LOOP->last_error = req->error;
buf.base = 0;
buf.len = 0;
buf = (handle->flags & UV_HANDLE_ZERO_READ) ?
uv_buf_init(NULL, 0) : handle->read_buffer;
handle->read_cb((uv_stream_t*)handle, -1, buf);
}
} else {