summaryrefslogtreecommitdiffstats
path: root/web
diff options
context:
space:
mode:
authorStelios Fragkakis <52996999+stelfrag@users.noreply.github.com>2023-07-11 12:32:06 +0300
committerGitHub <noreply@github.com>2023-07-11 12:32:06 +0300
commit75ecb70175a778a8a389307b0048cf8fd53c5064 (patch)
tree7c6435e190d0873495618bb60cc4e8eeddea0db4 /web
parent4f3c121799f6be21da26fb2bf946907fd978ca63 (diff)
Fix coverity issues (#15345)
* sensor_name always has a value -- CID 395493: Control flow issues (DEADCODE) * Check fopen failure -- CID 395492: Null pointer dereferences (NULL_RETURNS) * CID 395491: Control flow issues (DEADCODE) * sel_count will be >=0 in this case -- CID 395490: Control flow issues (DEADCODE) * Memory leak -- CID 395487: Resource leaks (RESOURCE_LEAK)
Diffstat (limited to 'web')
-rw-r--r--web/api/web_api_v2.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/web/api/web_api_v2.c b/web/api/web_api_v2.c
index c4727f75d9..29bbb10bbf 100644
--- a/web/api/web_api_v2.c
+++ b/web/api/web_api_v2.c
@@ -103,11 +103,11 @@ static bool verify_agent_uuids(const char *machine_guid, const char *node_id, co
return false;
char *agent_claim_id = get_agent_claimid();
- if(!agent_claim_id || strcmp(claim_id, agent_claim_id) != 0)
- return false;
+
+ bool not_verified = (!agent_claim_id || strcmp(claim_id, agent_claim_id) != 0);
freez(agent_claim_id);
- if(!localhost->node_id)
+ if(not_verified || !localhost->node_id)
return false;
char buf[UUID_STR_LEN];