kern

diff src/rbtree.c @ 73:b4b7198986a6

fixed a potential null dereference when deleting a bug in the redblack tree
author John Tsiombikas <nuclear@member.fsf.org>
date Sat, 15 Oct 2011 08:06:10 +0300
parents b45e2d5f0ae1
children
line diff
     1.1 --- a/src/rbtree.c	Sat Oct 15 07:45:56 2011 +0300
     1.2 +++ b/src/rbtree.c	Sat Oct 15 08:06:10 2011 +0300
     1.3 @@ -248,7 +248,9 @@
     1.4  	del_tree(node->left, delfunc, cls);
     1.5  	del_tree(node->right, delfunc, cls);
     1.6  
     1.7 -	delfunc(node, cls);
     1.8 +	if(delfunc) {
     1.9 +		delfunc(node, cls);
    1.10 +	}
    1.11  	free(node);
    1.12  }
    1.13