From e8a622d76a5edc80a349ca7eb794a93675bcf2d5 Mon Sep 17 00:00:00 2001 From: Mark Andrews Date: Fri, 30 Nov 2012 18:50:38 +1100 Subject: [PATCH] silence clang --analyze warnings --- bin/named/client.c | 4 ++-- lib/dns/dispatch.c | 2 +- lib/dns/rbt.c | 4 ++++ lib/dns/rbtdb.c | 1 + lib/isc/include/isc/queue.h | 4 ++-- 5 files changed, 10 insertions(+), 5 deletions(-) diff --git a/bin/named/client.c b/bin/named/client.c index 0cf08b4997..933abc7631 100644 --- a/bin/named/client.c +++ b/bin/named/client.c @@ -2510,10 +2510,10 @@ ns_clientmgr_create(isc_mem_t *mctx, isc_taskmgr_t *taskmgr, return (ISC_R_SUCCESS); cleanup_listlock: - isc_mutex_destroy(&manager->listlock); + (void) isc_mutex_destroy(&manager->listlock); cleanup_lock: - isc_mutex_destroy(&manager->lock); + (void) isc_mutex_destroy(&manager->lock); cleanup_manager: isc_mem_put(manager->mctx, manager, sizeof(*manager)); diff --git a/lib/dns/dispatch.c b/lib/dns/dispatch.c index c460302497..980b640d68 100644 --- a/lib/dns/dispatch.c +++ b/lib/dns/dispatch.c @@ -733,7 +733,7 @@ destroy_disp(isc_task_t *task, isc_event_t *event) { if (disp->sepool != NULL) { isc_mempool_destroy(&disp->sepool); - isc_mutex_destroy(&disp->sepool_lock); + (void)isc_mutex_destroy(&disp->sepool_lock); } if (disp->socket != NULL) diff --git a/lib/dns/rbt.c b/lib/dns/rbt.c index 4e033d66ed..eb95d14fbc 100644 --- a/lib/dns/rbt.c +++ b/lib/dns/rbt.c @@ -1537,6 +1537,8 @@ rehash(dns_rbt_t *rbt) { return; } + INSIST(rbt->hashsize > 0); + for (i = 0; i < rbt->hashsize; i++) rbt->hashtable[i] = NULL; @@ -1947,6 +1949,7 @@ dns_rbt_deletefromlevel(dns_rbtnode_t *delete, dns_rbtnode_t **rootp) { COLOR(sibling) = COLOR(parent); MAKE_BLACK(parent); + INSIST(RIGHT(sibling) != NULL); MAKE_BLACK(RIGHT(sibling)); rotate_left(parent, rootp); child = *rootp; @@ -1984,6 +1987,7 @@ dns_rbt_deletefromlevel(dns_rbtnode_t *delete, dns_rbtnode_t **rootp) { COLOR(sibling) = COLOR(parent); MAKE_BLACK(parent); + INSIST(LEFT(sibling) != NULL); MAKE_BLACK(LEFT(sibling)); rotate_right(parent, rootp); child = *rootp; diff --git a/lib/dns/rbtdb.c b/lib/dns/rbtdb.c index 4a0fcc6af7..af7cddb3bd 100644 --- a/lib/dns/rbtdb.c +++ b/lib/dns/rbtdb.c @@ -6224,6 +6224,7 @@ add(dns_rbtdb_t *rbtdb, dns_rbtnode_t *rbtnode, rbtdb_version_t *rbtversion, * will do it on the LRU side, so memory * will not leak... for long. */ + INSIST(rbtdb->heaps != NULL); isc_heap_insert(rbtdb->heaps[idx], newheader); } else if (RESIGN(newheader)) resign_insert(rbtdb, idx, newheader); diff --git a/lib/isc/include/isc/queue.h b/lib/isc/include/isc/queue.h index fc421beaa8..d71bce7986 100644 --- a/lib/isc/include/isc/queue.h +++ b/lib/isc/include/isc/queue.h @@ -61,8 +61,8 @@ #define ISC_QUEUE_DESTROY(queue) \ do { \ ISC_QLINK_INSIST(ISC_QUEUE_EMPTY(queue)); \ - isc_mutex_destroy(&(queue).taillock); \ - isc_mutex_destroy(&(queue).headlock); \ + (void) isc_mutex_destroy(&(queue).taillock); \ + (void) isc_mutex_destroy(&(queue).headlock); \ } while (0) /*