Skip to content

Commit c03bd57

Browse files
bnoordhuisMyles Borins
authored and
Myles Borins
committed
src: check uv_async_init() return value
Pointed out by Coverity. PR-URL: #7374 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Michael Dawson <[email protected]>
1 parent 1baa145 commit c03bd57

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

src/node.cc

+3-3
Original file line numberDiff line numberDiff line change
@@ -3857,9 +3857,9 @@ void Init(int* argc,
38573857

38583858
// init async debug messages dispatching
38593859
// Main thread uses uv_default_loop
3860-
uv_async_init(uv_default_loop(),
3861-
&dispatch_debug_messages_async,
3862-
DispatchDebugMessagesAsyncCallback);
3860+
CHECK_EQ(0, uv_async_init(uv_default_loop(),
3861+
&dispatch_debug_messages_async,
3862+
DispatchDebugMessagesAsyncCallback));
38633863
uv_unref(reinterpret_cast<uv_handle_t*>(&dispatch_debug_messages_async));
38643864

38653865
#if defined(NODE_V8_OPTIONS)

src/node_win32_etw_provider.cc

+3-3
Original file line numberDiff line numberDiff line change
@@ -155,9 +155,9 @@ void init_etw() {
155155
event_write = (EventWriteFunc)GetProcAddress(advapi, "EventWrite");
156156

157157
// create async object used to invoke main thread from callback
158-
uv_async_init(uv_default_loop(),
159-
&dispatch_etw_events_change_async,
160-
etw_events_change_async);
158+
CHECK_EQ(0, uv_async_init(uv_default_loop(),
159+
&dispatch_etw_events_change_async,
160+
etw_events_change_async));
161161
uv_unref(reinterpret_cast<uv_handle_t*>(&dispatch_etw_events_change_async));
162162

163163
if (event_register) {

0 commit comments

Comments
 (0)