]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
2199. [bug] win32: don't call WSAStartup() while loading dlls.
authorMark Andrews <marka@isc.org>
Mon, 18 Jun 2007 03:30:39 +0000 (03:30 +0000)
committerMark Andrews <marka@isc.org>
Mon, 18 Jun 2007 03:30:39 +0000 (03:30 +0000)
                        [RT #16911]

lib/lwres/context.c
lib/lwres/getipnode.c

index eee10c32de3eb10b368b1cd04cf8b6e431a869ed..d360bca9679a17f9174e1fc423c218e6a7738a20 100644 (file)
@@ -15,7 +15,7 @@
  * PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: context.c,v 1.45.18.4 2007/06/18 03:08:56 marka Exp $ */
+/* $Id: context.c,v 1.45.18.5 2007/06/18 03:30:39 marka Exp $ */
 
 /*! \file context.c 
    lwres_context_create() creates a #lwres_context_t structure for use in
@@ -322,8 +322,12 @@ context_connect(lwres_context_t *ctx) {
        InitSockets();
 #endif
        s = socket(domain, SOCK_DGRAM, IPPROTO_UDP);
-       if (s < 0)
+       if (s < 0) {
+#ifdef WIN32
+               DestroySockets();
+#endif
                return (LWRES_R_IOERROR);
+       }
 
        ret = connect(s, sa, salen);
        if (ret != 0) {
index a708d5aaf2254268898eca6cceb1dd2da052ad62..dd0e0d551afdcbf4de5794a3af79e33206d6930b 100644 (file)
@@ -15,7 +15,7 @@
  * PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: getipnode.c,v 1.37.18.4 2007/06/18 03:08:56 marka Exp $ */
+/* $Id: getipnode.c,v 1.37.18.5 2007/06/18 03:30:39 marka Exp $ */
 
 /*! \file */
 
@@ -818,12 +818,11 @@ scan_interfaces(int *have_v4, int *have_v6) {
  err_ret:
        if (buf != NULL)
                free(buf);
-       if (s != -1) {
+       if (s != -1)
+               close(s);
 #ifdef WIN32
-               DestroySockets();
+       DestroySockets();
 #endif
-               close(s);
-       }
        return (-1);
 #endif
 }