* sendto_kdc.c (start_connection): Close socket if connect() call fails for an
authorKen Raeburn <raeburn@mit.edu>
Thu, 26 Feb 2004 00:38:01 +0000 (00:38 +0000)
committerKen Raeburn <raeburn@mit.edu>
Thu, 26 Feb 2004 00:38:01 +0000 (00:38 +0000)
unexpected reason.

ticket: 2277
status: open

git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@16123 dc483132-0cff-0310-8789-dd5450dbe970

src/lib/krb5/os/ChangeLog
src/lib/krb5/os/sendto_kdc.c

index b014a098d0cc8772d50d163c40f0f4ba677b727d..2890ccfc23bd5338aafc8fc670ff59af60d3e11b 100644 (file)
@@ -1,3 +1,8 @@
+2004-02-25  Ken Raeburn  <raeburn@mit.edu>
+
+       * sendto_kdc.c (start_connection): Close socket if connect() call
+       fails for an unexpected reason.
+
 2004-02-13  Ken Raeburn  <raeburn@mit.edu>
 
        * genaddrs.c: Don't specify defaults for
index 4e9df2e3a37e738447e569d853613fdaab7f3e53..66a5a520f668b7c034d10e5620b706bb6248f00f 100644 (file)
@@ -564,6 +564,7 @@ start_connection (struct conn_state *state, struct select_state *selstate)
            state->state = CONNECTING;
        } else {
            dprint("connect failed: %m\n", SOCKET_ERRNO);
+           (void) closesocket(fd);
            state->err = SOCKET_ERRNO;
            state->state = FAILED;
            return -2;