missing extra parens around recvfrom.
authorJohn Kohl <jtkohl@mit.edu>
Thu, 19 Apr 1990 15:22:50 +0000 (15:22 +0000)
committerJohn Kohl <jtkohl@mit.edu>
Thu, 19 Apr 1990 15:22:50 +0000 (15:22 +0000)
close the sockets, not the index to the sockets, and only
do the active sockets.

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

src/lib/krb5/os/sendto_kdc.c

index acc17c542c8ac5a200c61aac806bbb49325d0c4b..f38ec31836e5f9645c56c3cf0968168cc6ae6cb1 100644 (file)
@@ -123,12 +123,12 @@ OLDDECLARG(krb5_data *, reply)
                                &waitlen)) {
                if (nready == -1)
                    continue;           /* XXX */
-               if (cc = recvfrom(socklist[addr[host].sa_family],
-                                 reply->data,
-                                 reply->length,
-                                 0,
-                                 &fromaddr,
-                                 &fromlen) == -1)
+               if ((cc = recvfrom(socklist[addr[host].sa_family],
+                                  reply->data,
+                                  reply->length,
+                                  0,
+                                  &fromaddr,
+                                  &fromlen)) == -1)
                    continue;           /* XXX */
                if (bcmp((char *)&fromaddr, (char *)&addr[host],
                         fromlen)) {
@@ -159,7 +159,8 @@ OLDDECLARG(krb5_data *, reply)
     retval = KRB5_KDC_UNREACH;
  out:
     for (i = 0; i < AF_MAX; i++)
-       (void) close(i);
+       if (socklist[i] != -1)
+           (void) close(socklist[i]);
     free((char *)addr);
     if (retval) {
        free(reply->data);