Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
Browse files

windows: fix memory leak when non-zero tcp reads are used

  • Loading branch information
Igor Zinkovsky
Igor Zinkovsky committed Dec 12, 2011
1 parent ba52023 commit 4e99cd4e29d3b6fae1dd9cd701997259f9040113
Showing with 2 additions and 1 deletion.
  1. +2 −1 src/win/tcp.c
@@ -822,7 +822,8 @@ void uv_process_tcp_read_req(uv_loop_t* loop, uv_tcp_t* handle,

if (!REQ_SUCCESS(req)) {
/* An error occurred doing the read. */
if ((handle->flags & UV_HANDLE_READING)) {
if ((handle->flags & UV_HANDLE_READING) ||
!(handle->flags & UV_HANDLE_ZERO_READ)) {
handle->flags &= ~UV_HANDLE_READING;
buf = (handle->flags & UV_HANDLE_ZERO_READ) ?
uv_buf_init(NULL, 0) : handle->read_buffer;

0 comments on commit 4e99cd4

Please sign in to comment.
You can’t perform that action at this time.