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 <santiago.gimeno@gmail.com>
This commit is contained in:
cjihrig 2018-08-12 13:12:15 -04:00
parent 76b873e837
commit 7284adfa7a
No known key found for this signature in database
GPG Key ID: 7434390BDBE9B9C5

View File

@ -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);