From 7284adfa7a833264fc67d68d39610da27ecbab7c Mon Sep 17 00:00:00 2001 From: cjihrig Date: Sun, 12 Aug 2018 13:12:15 -0400 Subject: [PATCH] win: return UV_ENOMEM from uv_loop_init() This commit sets the error returned by uv_loop_init() to UV_ENOMEM in the case of a failed timer heap malloc. PR-URL: https://github.com/libuv/libuv/pull/1944 Reviewed-By: Santiago Gimeno --- src/win/core.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/win/core.c b/src/win/core.c index 5a76c900..afdf01e7 100644 --- a/src/win/core.c +++ b/src/win/core.c @@ -249,8 +249,10 @@ int uv_loop_init(uv_loop_t* loop) { loop->endgame_handles = NULL; loop->timer_heap = timer_heap = uv__malloc(sizeof(*timer_heap)); - if (timer_heap == NULL) + if (timer_heap == NULL) { + err = UV_ENOMEM; goto fail_timers_alloc; + } heap_init(timer_heap);