diff options
author | dougb <dougb@FreeBSD.org> | 2009-12-14 21:50:34 +0000 |
---|---|---|
committer | dougb <dougb@FreeBSD.org> | 2009-12-14 21:50:34 +0000 |
commit | 5dd00d812f30d20da01b7267fe267b166aea4d0f (patch) | |
tree | 0fbf0c6edb8f8fa834bdccea45d1c9f857d09481 /contrib/bind9 | |
parent | b8d8e16495c264f94d3bd54164b1338f5c7c67e6 (diff) | |
download | FreeBSD-src-5dd00d812f30d20da01b7267fe267b166aea4d0f.zip FreeBSD-src-5dd00d812f30d20da01b7267fe267b166aea4d0f.tar.gz |
Wrap some socket handling code in a !NULL bow
This patch or something similar will likely be included in a future
BIND release.
PR: bin/138061
Submitted by: Michael Baker <michael.baker@diversit.com.au>
Original patch submitted by: Volker <volker@vwsoft.com>
Patch reviewed and tweaked by: ISC
Diffstat (limited to 'contrib/bind9')
-rw-r--r-- | contrib/bind9/bin/dig/dighost.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/contrib/bind9/bin/dig/dighost.c b/contrib/bind9/bin/dig/dighost.c index 470261c..73264e6 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; |