From 6292bbbd245cb64a346f5126670085e656e89a88 Mon Sep 17 00:00:00 2001 From: Dimitri Staessens Date: Sat, 23 Aug 2025 11:01:57 +0200 Subject: build: Add some hints for scan-build The scan-build tool was pointing out some potential issues that were understood or false positives. Added some asserts so scan-build can complete successfully without these warnings. Signed-off-by: Dimitri Staessens --- src/ipcpd/unicast/dir/dht.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/ipcpd/unicast') diff --git a/src/ipcpd/unicast/dir/dht.c b/src/ipcpd/unicast/dir/dht.c index 656b8b94..858fad0b 100644 --- a/src/ipcpd/unicast/dir/dht.c +++ b/src/ipcpd/unicast/dir/dht.c @@ -1450,6 +1450,7 @@ static ssize_t dht_kv_wait_req(const uint8_t * key, return i; no_vals: pthread_mutex_unlock(&dht.reqs.mtx); + *vals = NULL; return 0; fail_val_data: freebufs(*vals, i); @@ -3285,6 +3286,8 @@ uint64_t dht_query(const uint8_t * key) } if (n == 0) { + assert(vals == NULL); + log_dbg(KEY_FMT " No local values.", KEY_VAL(key)); n = dht_kv_query_remote(key, &vals, NULL); if (n < 0) { -- cgit v1.2.3