2017-06-15 15:50:41 +00:00
|
|
|
diff --git a/bin/dig/dighost.c b/bin/dig/dighost.c
|
|
|
|
index f657c30..ff9a2d2 100644
|
|
|
|
--- a/bin/dig/dighost.c
|
|
|
|
+++ b/bin/dig/dighost.c
|
|
|
|
@@ -1694,6 +1694,13 @@ clear_query(dig_query_t *query) {
|
2008-12-03 12:38:21 +00:00
|
|
|
|
2017-06-15 15:50:41 +00:00
|
|
|
if (query->timer != NULL)
|
|
|
|
isc_timer_detach(&query->timer);
|
|
|
|
+
|
2008-12-03 12:38:21 +00:00
|
|
|
+ if (query->waiting_senddone) {
|
|
|
|
+ debug("send_done not yet called");
|
|
|
|
+ query->pending_free = ISC_TRUE;
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
lookup = query->lookup;
|
|
|
|
|
|
|
|
if (lookup->current_query == query)
|
2017-06-15 15:50:41 +00:00
|
|
|
@@ -1719,10 +1726,7 @@ clear_query(dig_query_t *query) {
|
2008-12-03 12:38:21 +00:00
|
|
|
isc_mempool_put(commctx, query->recvspace);
|
|
|
|
isc_buffer_invalidate(&query->recvbuf);
|
|
|
|
isc_buffer_invalidate(&query->lengthbuf);
|
|
|
|
- if (query->waiting_senddone)
|
|
|
|
- query->pending_free = ISC_TRUE;
|
|
|
|
- else
|
|
|
|
- isc_mem_free(mctx, query);
|
|
|
|
+ isc_mem_free(mctx, query);
|
|
|
|
}
|
|
|
|
|
|
|
|
/*%
|
2017-06-15 15:50:41 +00:00
|
|
|
@@ -2811,9 +2815,9 @@ send_done(isc_task_t *_task, isc_event_t *event) {
|
2008-12-03 12:38:21 +00:00
|
|
|
isc_event_free(&event);
|
|
|
|
|
|
|
|
if (query->pending_free)
|
|
|
|
- isc_mem_free(mctx, query);
|
|
|
|
+ clear_query(query);
|
|
|
|
|
|
|
|
- check_if_done();
|
|
|
|
+ check_next_lookup(l);
|
|
|
|
UNLOCK_LOOKUP;
|
|
|
|
}
|
|
|
|
|