Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 7 Nov 2009 18:55:39 +0000 (UTC)
From:      Doug Barton <dougb@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r199019 - head/contrib/bind9/bin/dig
Message-ID:  <200911071855.nA7Itd9b060744@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: dougb
Date: Sat Nov  7 18:55:39 2009
New Revision: 199019
URL: http://svn.freebsd.org/changeset/base/199019

Log:
  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

Modified:
  head/contrib/bind9/bin/dig/dighost.c

Modified: head/contrib/bind9/bin/dig/dighost.c
==============================================================================
--- head/contrib/bind9/bin/dig/dighost.c	Sat Nov  7 18:42:53 2009	(r199018)
+++ head/contrib/bind9/bin/dig/dighost.c	Sat Nov  7 18:55:39 2009	(r199019)
@@ -2604,10 +2604,12 @@ connect_done(isc_task_t *task, isc_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;



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200911071855.nA7Itd9b060744>