From b2870827a37d10be4fb7b9099efead19f9113f70 Mon Sep 17 00:00:00 2001 From: Hiroki Sato Date: Tue, 17 Jan 2012 20:39:33 +0000 Subject: [PATCH] Revert changes in r228790. It prevented the ypserv daemon from working with with multiple socktypes. --- usr.sbin/ypserv/yp_main.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/usr.sbin/ypserv/yp_main.c b/usr.sbin/ypserv/yp_main.c index 569e558ba3e0..69dae295c8f7 100644 --- a/usr.sbin/ypserv/yp_main.c +++ b/usr.sbin/ypserv/yp_main.c @@ -256,7 +256,6 @@ create_service(const int sock, const struct netconfig *nconf, const struct __rpc_sockinfo *si) { int error; - char *sname; SVCXPRT *transp; struct addrinfo hints, *res, *res0; @@ -264,7 +263,6 @@ create_service(const int sock, const struct netconfig *nconf, struct bindaddrlistent *blep; struct netbuf svcaddr; - sname = NULL; SLIST_INIT(&sle_head); memset(&hints, 0, sizeof(hints)); memset(&svcaddr, 0, sizeof(svcaddr)); @@ -344,6 +342,7 @@ create_service(const int sock, const struct netconfig *nconf, if (strncmp("0", servname, 1) == 0) { struct sockaddr *sap; socklen_t slen; + char *sname; sname = malloc(NI_MAXSERV); if (sname == NULL) { @@ -444,7 +443,6 @@ create_service(const int sock, const struct netconfig *nconf, } /* XXX: ignore error intentionally */ rpcb_set(YPPROG, YPVERS, nconf, &svcaddr); - free(sname); freeaddrinfo(res0); return 0; }