rbtree
diff src/rbtree.c @ 7:2c0baa1fd419
del_tree would call 0 if the del func is null
author | John Tsiombikas <nuclear@member.fsf.org> |
---|---|
date | Fri, 21 Oct 2011 11:32:38 +0300 |
parents | 56a08d00bb41 |
children | b45febfd2922 |
line diff
1.1 --- a/src/rbtree.c Wed Oct 12 07:03:03 2011 +0300 1.2 +++ b/src/rbtree.c Fri Oct 21 11:32:38 2011 +0300 1.3 @@ -261,7 +261,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