silence null pointer dereference warning by adding INSIST(sibling != NULL);

This commit is contained in:
Mark Andrews 2011-08-25 06:12:57 +00:00
parent 4ff494c9a6
commit 2afb4a9d7d

View file

@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: rbt.c,v 1.146.278.2 2011/03/12 04:59:17 tbox Exp $ */
/* $Id: rbt.c,v 1.146.278.3 2011/08/25 06:12:57 marka Exp $ */
/*! \file */
@ -1929,6 +1929,8 @@ dns_rbt_deletefromlevel(dns_rbtnode_t *delete, dns_rbtnode_t **rootp) {
sibling = RIGHT(parent);
}
INSIST(sibling != NULL);
if (IS_BLACK(LEFT(sibling)) &&
IS_BLACK(RIGHT(sibling))) {
MAKE_RED(sibling);
@ -1965,6 +1967,8 @@ dns_rbt_deletefromlevel(dns_rbtnode_t *delete, dns_rbtnode_t **rootp) {
sibling = LEFT(parent);
}
INSIST(sibling != NULL);
if (IS_BLACK(LEFT(sibling)) &&
IS_BLACK(RIGHT(sibling))) {
MAKE_RED(sibling);