sel/bres.c: Don't capture `h->h_name' in non-`const' pointer.
[mLib] / sel / bres.c
index cc44049..22da560 100644 (file)
@@ -473,38 +473,33 @@ static void child(int rfd, int cfd)
        if (doread(cfd, &addr, sizeof(addr)))
          goto lose;
        if ((h = gethostbyaddr((char *)&addr, sizeof(addr), AF_INET)) == 0)
-         goto fail;
+         goto skip;
 
        /* --- Do a forward lookup to confirm --- */
 
        {
          size_t sz = strlen(h->h_name) + 1;
          if ((p = malloc(sz)) == 0)
-           goto fail;
+           goto skip;
          memcpy(p, h->h_name, sz);
        }
 
        h = gethostbyname(p);
        free(p);
        if (!h)
-         goto fail;
-       p = 0;
+         goto skip;
        if (h) {
          char **pp;
          for (pp = h->h_addr_list; *pp; pp++) {
            struct in_addr a;
            memcpy(&a, *pp, sizeof(a));
-           if (a.s_addr == addr.s_addr) {
-             p = h->h_name;
-             break;
-           }
+           if (a.s_addr == addr.s_addr)
+             goto skip;
          }
        }
-       if (!p) {
-         h = 0;
-         h_errno = NO_RECOVERY;
-       }
-      fail:;
+       h = 0;
+       h_errno = NO_RECOVERY;
+      skip:;
       }        break;
 
       /* --- Unknown request -- may have lost sync --- */