Commit 23708ddb authored by Marek Vavrusa's avatar Marek Vavrusa
Browse files

daemon/io: freed handle could be touched in libuv

the daemon wrongly freed handle that returned 0,
as in "no more data". this socket is going to be
closed, but it still could be touched by libuv
so it must be freed wit uv_close() handler
parent 644e8f61
......@@ -215,7 +215,7 @@ static void tcp_accept(uv_stream_t *master, int status)
memset(client, 0, sizeof(*client));
io_create(master->loop, (uv_handle_t *)client, SOCK_STREAM);
if (uv_accept(master, client) != 0) {
io_free((uv_handle_t *)client);
uv_close((uv_handle_t *)client, io_free);
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment