Fix a Coverity issue (#7780)
Vladimir Kobal committed
Jan 17, 2020 at 18:04 UTC
d423c30847a3cf75833b5c2a6e93799cfd8462b9
1 file changed
+5
-1
exporting/init_connectors.c
+5
-1
@@ -64,7 +64,11 @@ int init_connectors(struct engine *engine)
64
}
65
66
// dispatch the instance worker thread
67
- uv_thread_create(&instance->thread, connector->worker, instance);
67
+ int error = uv_thread_create(&instance->thread, connector->worker, instance);
68
+ if (error) {
69
+ error("EXPORTING: cannot create tread worker. uv_thread_create(): %s", uv_strerror(error));
70
+ return 1;
71
+ }
72
char threadname[NETDATA_THREAD_NAME_MAX+1];
73
snprintfz(threadname, NETDATA_THREAD_NAME_MAX, "EXPORTING-%zu", instance->index);
74
uv_thread_set_name_np(instance->thread, threadname);