chiark / gitweb /
Reentrancy: Avoid reentrant callbacks
[adns.git] / src / setup.c
index eca75033167d0a8b7226db9ab423e3dad7e8f65e..fc1a01327dc3887cbcca41da5d88973527d373e0 100644 (file)
@@ -578,6 +578,7 @@ static int init_begin(adns_state *ads_r, adns_initflags flags,
   LIST_INIT(ads->tcpw);
   LIST_INIT(ads->childw);
   LIST_INIT(ads->output);
+  LIST_INIT(ads->intdone);
   ads->forallnext= 0;
   ads->nextid= 0x311f;
   ads->nudp= 0;
@@ -749,6 +750,7 @@ void adns_finish(adns_state ads) {
     else if (ads->tcpw.head) adns__cancel(ads->tcpw.head);
     else if (ads->childw.head) adns__cancel(ads->childw.head);
     else if (ads->output.head) adns__cancel(ads->output.head);
+    else if (ads->intdone.head) adns__cancel(ads->output.head);
     else break;
   }
   for (i=0; i<ads->nudp; i++) close(ads->udpsocket[i].fd);