From c03bd57ac6036993a7edf91c70d896757a3c8ffd Mon Sep 17 00:00:00 2001 From: Ben Noordhuis Date: Wed, 22 Jun 2016 13:03:46 +0200 Subject: [PATCH] src: check uv_async_init() return value Pointed out by Coverity. PR-URL: https://github.com/nodejs/node/pull/7374 Reviewed-By: Anna Henningsen Reviewed-By: Colin Ihrig Reviewed-By: James M Snell Reviewed-By: Michael Dawson --- src/node.cc | 6 +++--- src/node_win32_etw_provider.cc | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/node.cc b/src/node.cc index 9be6fa5c507196..d05237e2b726b4 100644 --- a/src/node.cc +++ b/src/node.cc @@ -3857,9 +3857,9 @@ void Init(int* argc, // init async debug messages dispatching // Main thread uses uv_default_loop - uv_async_init(uv_default_loop(), - &dispatch_debug_messages_async, - DispatchDebugMessagesAsyncCallback); + CHECK_EQ(0, uv_async_init(uv_default_loop(), + &dispatch_debug_messages_async, + DispatchDebugMessagesAsyncCallback)); uv_unref(reinterpret_cast(&dispatch_debug_messages_async)); #if defined(NODE_V8_OPTIONS) diff --git a/src/node_win32_etw_provider.cc b/src/node_win32_etw_provider.cc index 6877f1977dae8b..f2650af93a51d6 100644 --- a/src/node_win32_etw_provider.cc +++ b/src/node_win32_etw_provider.cc @@ -155,9 +155,9 @@ void init_etw() { event_write = (EventWriteFunc)GetProcAddress(advapi, "EventWrite"); // create async object used to invoke main thread from callback - uv_async_init(uv_default_loop(), - &dispatch_etw_events_change_async, - etw_events_change_async); + CHECK_EQ(0, uv_async_init(uv_default_loop(), + &dispatch_etw_events_change_async, + etw_events_change_async)); uv_unref(reinterpret_cast(&dispatch_etw_events_change_async)); if (event_register) {