dtprintinfo: Coverity 89561
[oweals/cde.git] / cde / programs / dtlogin / chooser.c
index 37e617fc6fab3f4eb6523079dd370f44dc0a7cdf..dd034dc1569b9756ea04c07027d8c5eba28d4c98 100644 (file)
@@ -16,7 +16,7 @@
  * details.
  *
  * You should have received a copy of the GNU Lesser General Public
- * License along with these librararies and programs; if not, write
+ * License along with these libraries and programs; if not, write
  * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
  * Floor, Boston, MA 02110-1301 USA
  */
@@ -397,7 +397,6 @@ AddHostname (ARRAY8Ptr hostname, ARRAY8Ptr status, struct sockaddr *addr, int wi
        }
        if (!XdmcpAllocARRAY8 (&new->hostaddr, hostAddr.length))
        {
-           free ((char *) new->fullname);
            free ((char *) new);
            return 0;
        }
@@ -583,7 +582,7 @@ RegisterHostname (char *name)
     struct hostent     *hostent;
     struct sockaddr_in in_addr;
     struct ifconf      ifc;
-    register struct ifreq *ifr;
+    struct ifreq *ifr;
     struct sockaddr    broad_addr;
     char               buf[2048];
     int                        n;
@@ -595,7 +594,7 @@ RegisterHostname (char *name)
        if (ioctl (socketFD, (int) SIOCGIFCONF, (char *) &ifc) < 0)
            return 0;
        for (ifr = ifc.ifc_req
-#if defined (__bsdi__) || defined(__NetBSD__)
+#if defined(__NetBSD__)
             ; (char *)ifr < ifc.ifc_buf + ifc.ifc_len;
             ifr = (struct ifreq *)((char *)ifr + sizeof (struct ifreq) +
                (ifr->ifr_addr.sa_len > sizeof (ifr->ifr_addr) ?
@@ -759,6 +758,9 @@ Choose (HostName *h)
            addr = (struct sockaddr *) &in_addr;
            len = sizeof (in_addr);
            break;
+        default:
+           fprintf (stderr, "Unhandled protocol family %d\n", family);
+           exit (REMANAGE_DISPLAY);
        }
        if ((fd = socket (family, SOCK_STREAM, 0)) == -1)
        {