svn commit: r200546 - stable/8/contrib/bind9/bin/dig

Doug Barton dougb at FreeBSD.org
Mon Dec 14 13:50:35 PST 2009


Author: dougb
Date: Mon Dec 14 21:50:34 2009
New Revision: 200546
URL: http://svn.freebsd.org/changeset/base/200546

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 at diversit.com.au>
  Original patch submitted by:	Volker <volker at vwsoft.com>
  Patch reviewed and tweaked by:	ISC

Modified:
  stable/8/contrib/bind9/bin/dig/dighost.c
Directory Properties:
  stable/8/contrib/bind9/   (props changed)

Modified: stable/8/contrib/bind9/bin/dig/dighost.c
==============================================================================
--- stable/8/contrib/bind9/bin/dig/dighost.c	Mon Dec 14 21:16:02 2009	(r200545)
+++ stable/8/contrib/bind9/bin/dig/dighost.c	Mon Dec 14 21:50:34 2009	(r200546)
@@ -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;


More information about the svn-src-stable-8 mailing list