From 4ac8c424ea36b069c76e91fde3eb2f42e0e292f9 Mon Sep 17 00:00:00 2001 From: Fedor Indutny Date: Thu, 13 Mar 2014 00:48:55 +0400 Subject: [PATCH] win: fix buffer leak on error in pipe.c --- src/win/pipe.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/win/pipe.c b/src/win/pipe.c index cce1d990..ee0c0f88 100644 --- a/src/win/pipe.c +++ b/src/win/pipe.c @@ -1240,9 +1240,9 @@ static void uv_pipe_read_eof(uv_loop_t* loop, uv_pipe_t* handle, uv__set_artificial_error(loop, UV_EOF); if (handle->read2_cb) { - handle->read2_cb(handle, -1, uv_null_buf_, UV_UNKNOWN_HANDLE); + handle->read2_cb(handle, -1, buf, UV_UNKNOWN_HANDLE); } else { - handle->read_cb((uv_stream_t*) handle, -1, uv_null_buf_); + handle->read_cb((uv_stream_t*) handle, -1, buf); } } @@ -1404,7 +1404,7 @@ void uv_process_pipe_read_req(uv_loop_t* loop, uv_pipe_t* handle, break; } } else { - uv_pipe_read_error_or_eof(loop, handle, GetLastError(), uv_null_buf_); + uv_pipe_read_error_or_eof(loop, handle, GetLastError(), buf); break; } }