chiark / gitweb /
Changed memory semantics of internal queries to fix bugs.
[adns.git] / src / query.c
index b02abda87fc02e201bd4659a79a48c994f6253a0..12bd6ada4bc2d212114b836940943e23610a726e 100644 (file)
@@ -429,6 +429,8 @@ void adns__query_done(adns_query qu) {
   adns_answer *ans;
   adns_query parent;
 
+  cancel_children(qu);
+
   qu->id= -1;
   ans= qu->answer;
 
@@ -455,7 +457,7 @@ void adns__query_done(adns_query qu) {
   parent= qu->parent;
   if (parent) {
     LIST_UNLINK_PART(parent->children,qu,siblings.);
-    if (!parent->children.head) LIST_UNLINK(qu->ads->childw,parent);
+    LIST_UNLINK(qu->ads->childw,parent);
     qu->ctx.callback(parent,qu);
     free_query_allocs(qu);
     free(qu);