summaryrefslogtreecommitdiffstats
path: root/contrib/bind9
diff options
context:
space:
mode:
authordougb <dougb@FreeBSD.org>2009-11-07 18:55:39 +0000
committerdougb <dougb@FreeBSD.org>2009-11-07 18:55:39 +0000
commit2223d789e6a61a4cfe308b1ca96b54392f803b00 (patch)
tree893b7b20a86a69168b6f72e247638c46ca5fa8cb /contrib/bind9
parent254f71520c601b41f441f0ac45c842496b189db7 (diff)
downloadFreeBSD-src-2223d789e6a61a4cfe308b1ca96b54392f803b00.zip
FreeBSD-src-2223d789e6a61a4cfe308b1ca96b54392f803b00.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.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 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;
OpenPOWER on IntegriCloud