diff options
Diffstat (limited to 'lib/dns/keytable.c')
-rw-r--r-- | lib/dns/keytable.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/lib/dns/keytable.c b/lib/dns/keytable.c index 56fefcd2c122..29f129ffbf5f 100644 --- a/lib/dns/keytable.c +++ b/lib/dns/keytable.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2004, 2005, 2007, 2009, 2010, 2013, 2014 Internet Systems Consortium, Inc. ("ISC") + * Copyright (C) 2004, 2005, 2007, 2009, 2010, 2013-2015 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 2000, 2001 Internet Software Consortium. * * Permission to use, copy, modify, and/or distribute this software for any @@ -275,16 +275,17 @@ dns_keytable_deletekeynode(dns_keytable_t *keytable, dst_key_t *dstkey) { } knode = node->data; - if (knode->next == NULL && - (knode->key == NULL || - dst_key_compare(knode->key, dstkey) == ISC_TRUE)) { + if (knode->next == NULL && knode->key != NULL && + dst_key_compare(knode->key, dstkey) == ISC_TRUE) + { result = dns_rbt_deletenode(keytable->table, node, ISC_FALSE); goto finish; } kprev = (dns_keynode_t **) &node->data; while (knode != NULL) { - if (dst_key_compare(knode->key, dstkey) == ISC_TRUE) + if (knode->key != NULL && + dst_key_compare(knode->key, dstkey) == ISC_TRUE) break; kprev = &knode->next; knode = knode->next; |