diff --git a/deps/uv/src/unix/core.c b/deps/uv/src/unix/core.c index 7978e1bb200..91150360506 100644 --- a/deps/uv/src/unix/core.c +++ b/deps/uv/src/unix/core.c @@ -169,7 +169,15 @@ uv_loop_t* uv_loop_new(void) { void uv_loop_delete(uv_loop_t* loop) { uv_ares_destroy(loop, loop->channel); ev_loop_destroy(loop->ev); - free(loop); + +#ifndef NDEBUG + memset(loop, 0, sizeof *loop); +#endif + + if (loop == default_loop_ptr) + default_loop_ptr = NULL; + else + free(loop); } diff --git a/deps/uv/src/unix/error.c b/deps/uv/src/unix/error.c index 5f43709d753..e904d390333 100644 --- a/deps/uv/src/unix/error.c +++ b/deps/uv/src/unix/error.c @@ -82,6 +82,7 @@ uv_err_code uv_translate_sys_error(int sys_errno) { case EHOSTUNREACH: return UV_EHOSTUNREACH; case EAI_NONAME: return UV_ENOENT; case ESRCH: return UV_ESRCH; + case ETIMEDOUT: return UV_ETIMEDOUT; default: return UV_UNKNOWN; }