Skip to content

Commit

Permalink
win: return UV_ENOMEM from uv_loop_init()
Browse files Browse the repository at this point in the history
This commit sets the error returned by uv_loop_init() to
UV_ENOMEM in the case of a failed timer heap malloc.

PR-URL: libuv#1944
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
  • Loading branch information
cjihrig committed Aug 14, 2018
1 parent 76b873e commit 7284adf
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/win/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

0 comments on commit 7284adf

Please sign in to comment.