aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDoug Barton <dougb@FreeBSD.org>2009-12-14 21:50:34 +0000
committerDoug Barton <dougb@FreeBSD.org>2009-12-14 21:50:34 +0000
commit3a6f842965ae5f238a217fcd8c366b945770e5ca (patch)
tree0fbf0c6edb8f8fa834bdccea45d1c9f857d09481
parente88e64d392a28e4b47978dc52e53e85e46fa0976 (diff)
Notes
-rw-r--r--contrib/bind9/bin/dig/dighost.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/contrib/bind9/bin/dig/dighost.c b/contrib/bind9/bin/dig/dighost.c
index 470261cb2da7..73264e6c2ce9 100644
--- a/contrib/bind9/bin/dig/dighost.c
+++ b/contrib/bind9/bin/dig/dighost.c
@@ -2604,10 +2604,12 @@ connect_done(isc_task_t *task, isc_event_t *event) {
if (sevent->result == ISC_R_CANCELED) {
debug("in cancel handler");
- isc_socket_detach(&query->sock);
- sockcount--;
- INSIST(sockcount >= 0);
- debug("sockcount=%d", sockcount);
+ if (query->sock != NULL) {
+ isc_socket_detach(&query->sock);
+ sockcount--;
+ INSIST(sockcount >= 0);
+ debug("sockcount=%d", sockcount);
+ }
query->waiting_connect = ISC_FALSE;
isc_event_free(&event);
l = query->lookup;