@cryptotaxi247 / netdata / commits / 7b6fddb8f

Fix based on Coverity and Sonar audits (part 4) (#22332)

* claim: drop unreachable curl_slist cleanup on append failure Coverity CID 503493 (DEADCODE): in send_curl_request(), the failure path of curl_slist_append() called curl_slist_free_all() through `if(headers)` -- but `headers` is initialized to NULL on entry and only assigned after the append succeeds. The condition can never be true and the free is unreachable. Drop the dead block. The remaining cleanup (curl_easy_cleanup, can_retry=false, return false) is unchanged and correct. * claim: drop unreachable break in WndProc default case Sonar c:S1763: the `default:` case of the WndProc switch ended with `return DefWindowProc(...);` followed by `break;`. The break was unreachable. Remove the dead line. --------- Co-authored-by: Costa Tsaousis <costa@netdata.cloud>

Stelios Fragkakis committed May 1, 2026 at 11:23 UTC 7b6fddb8f4cfc704a6c73344bae689d19f1f61ff
2 files changed -3
src/claim/claim-with-api.c
-2
@@ -279,8 +279,6 @@ static bool send_curl_request(const char *machine_guid, const char *hostname, co
279 if(unlikely(!headers_with_content_type)) {
280 claim_agent_failure_reason_set("Cannot append Content-Type header to the claim request");
281 curl_easy_cleanup(curl);
282 - if(headers)
283 - curl_slist_free_all(headers);
282 *can_retry = false;
283 return false;
284 }
src/claim/ui.c
-1
@@ -49,7 +49,6 @@ LRESULT CALLBACK WndProc(HWND hNetdatawnd, UINT message, WPARAM wParam, LPARAM l
49 }
50 default: {
51 return DefWindowProc(hNetdatawnd, message, wParam, lParam);
52 - break;
52 }
53 }
54