From: Marek VavruĊĦa Date: Sun, 15 Nov 2015 11:29:31 +0000 (+0100) Subject: daemon: fixed leaking TCP handles when timeouted X-Git-Tag: v1.0.0-beta2~20 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1fb0dcdd723fcf5384df5a00529e07a2cece4cd5;p=thirdparty%2Fknot-resolver.git daemon: fixed leaking TCP handles when timeouted --- diff --git a/daemon/io.c b/daemon/io.c index 5f4232cec..04f2b6aec 100644 --- a/daemon/io.c +++ b/daemon/io.c @@ -91,6 +91,9 @@ static void tcp_recv(uv_stream_t *handle, ssize_t nread, const uv_buf_t *buf) if (handle->data) { worker_exec(worker, (uv_handle_t *)handle, NULL, NULL); } + if (!uv_is_closing((uv_handle_t *)handle)) { + uv_close((uv_handle_t *)handle, handle_free); + } return; }