mirror of
https://github.com/NLnetLabs/unbound.git
synced 2025-12-20 23:00:56 -05:00
- bug #452: fix crash on assert in mesh_state_attachment.
git-svn-id: file:///svn/unbound/trunk@2683 be551aaa-1e26-0410-a405-d3ace91eadb9
This commit is contained in:
parent
8903dd175a
commit
c42a74b77c
2 changed files with 13 additions and 6 deletions
|
|
@ -1,3 +1,6 @@
|
|||
11 June 2012: Wouter
|
||||
- bug #452: fix crash on assert in mesh_state_attachment.
|
||||
|
||||
30 May 2012: Wouter
|
||||
- silence warning from swig-generated code (md set but not used in
|
||||
swig initmodule, due to ifdefs in swig-generated code).
|
||||
|
|
|
|||
|
|
@ -735,16 +735,20 @@ int mesh_state_attachment(struct mesh_state* super, struct mesh_state* sub)
|
|||
superref->s = super;
|
||||
subref->node.key = subref;
|
||||
subref->s = sub;
|
||||
#ifdef UNBOUND_DEBUG
|
||||
n =
|
||||
#endif
|
||||
rbtree_insert(&sub->super_set, &superref->node);
|
||||
log_assert(n != NULL);
|
||||
if(!rbtree_insert(&sub->super_set, &superref->node)) {
|
||||
/* this should not happen, iterator and validator do not
|
||||
* attach subqueries that are identical. */
|
||||
/* already attached, we are done, nothing todo.
|
||||
* since superref and subref already allocated in region,
|
||||
* we cannot free them */
|
||||
return 1;
|
||||
}
|
||||
#ifdef UNBOUND_DEBUG
|
||||
n =
|
||||
#endif
|
||||
rbtree_insert(&super->sub_set, &subref->node);
|
||||
log_assert(n != NULL);
|
||||
log_assert(n != NULL); /* we checked above if statement, the reverse
|
||||
administration should not fail now, unless they are out of sync */
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue