From 81264cfcaf05b09b4733eaa607969d52b4856e34 Mon Sep 17 00:00:00 2001 From: number201724 Date: Mon, 26 Sep 2022 17:35:23 +0800 Subject: [PATCH] win: fix uv__pipe_accept memory leak (#3767) --- src/win/pipe.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/win/pipe.c b/src/win/pipe.c index bf605b10..1babe05c 100644 --- a/src/win/pipe.c +++ b/src/win/pipe.c @@ -1067,11 +1067,12 @@ int uv__pipe_accept(uv_pipe_t* server, uv_stream_t* client) { err = uv__tcp_xfer_import( (uv_tcp_t*) client, item->xfer_type, &item->xfer_info); + + uv__free(item); + if (err != 0) return err; - uv__free(item); - } else { pipe_client = (uv_pipe_t*) client; uv__pipe_connection_init(pipe_client);