]> git.ipfire.org Git - thirdparty/knot-resolver.git/commitdiff
daemon: fixed leaking TCP handles when timeouted
authorMarek Vavruša <marek.vavrusa@nic.cz>
Sun, 15 Nov 2015 11:29:31 +0000 (12:29 +0100)
committerMarek Vavruša <marek.vavrusa@nic.cz>
Sun, 15 Nov 2015 11:29:31 +0000 (12:29 +0100)
daemon/io.c

index 5f4232cec1f43ed24a6dc57ddc199d9b513160b7..04f2b6aec7850bdccfc31151870992a31074fe35 100644 (file)
@@ -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;
        }