@cryptotaxi247 / netdata-1 / commits / b3d01424a

Proper check for static_thread being NULL (#17821)

Add missing check

Stelios Fragkakis committed Jun 5, 2024 at 15:00 UTC b3d01424a65982fb9d8280c2eadfdf381da93766
3 files changed +4 -3
src/collectors/idlejitter.plugin/plugin_idlejitter.c
+1 -1
@@ -6,7 +6,7 @@
6
7 static void cpuidlejitter_main_cleanup(void *pptr) {
8 struct netdata_static_thread *static_thread = CLEANUP_FUNCTION_GET_PTR(pptr);
9 - if(!pptr) return;
9 + if(!static_thread) return;
10
11 static_thread->enabled = NETDATA_MAIN_THREAD_EXITING;
12
src/collectors/timex.plugin/plugin_timex.c
+1
@@ -33,6 +33,7 @@ struct status_codes {
33 static void timex_main_cleanup(void *pptr)
34 {
35 struct netdata_static_thread *static_thread = CLEANUP_FUNCTION_GET_PTR(pptr);
36 + if(!static_thread) return;
37
38 static_thread->enabled = NETDATA_MAIN_THREAD_EXITING;
39
src/web/api/http_header.c
+2 -2
@@ -118,14 +118,14 @@ static void http_header_x_forwarded_for(struct web_client *w, const char *v, siz
118 static void http_header_x_transaction_id(struct web_client *w, const char *v, size_t len) {
119 char buffer[UUID_STR_LEN * 2];
120 strncpyz(buffer, v, (len < sizeof(buffer) - 1 ? len : sizeof(buffer) - 1));
121 - uuid_parse_flexi(buffer, w->transaction); // will not alter w->transaction if it fails
121 + (void) uuid_parse_flexi(buffer, w->transaction); // will not alter w->transaction if it fails
122 }
123
124 static void http_header_x_netdata_account_id(struct web_client *w, const char *v, size_t len) {
125 if(web_client_flag_check(w, WEB_CLIENT_FLAG_CONN_CLOUD) && w->acl & HTTP_ACL_ACLK) {
126 char buffer[UUID_STR_LEN * 2];
127 strncpyz(buffer, v, (len < sizeof(buffer) - 1 ? len : sizeof(buffer) - 1));
128 - uuid_parse_flexi(buffer, w->auth.cloud_account_id); // will not alter w->cloud_account_id if it fails
128 + (void) uuid_parse_flexi(buffer, w->auth.cloud_account_id); // will not alter w->cloud_account_id if it fails
129 }
130 }
131