|
|
206f5e |
diff --git a/src/auth_gss.c b/src/auth_gss.c
|
|
|
206f5e |
index 5959893..7d08262 100644
|
|
|
206f5e |
--- a/src/auth_gss.c
|
|
|
206f5e |
+++ b/src/auth_gss.c
|
|
|
206f5e |
@@ -207,6 +207,7 @@ authgss_create(CLIENT *clnt, gss_name_t name, struct rpc_gss_sec *sec)
|
|
|
206f5e |
rpc_createerr.cf_stat = RPC_SYSTEMERROR;
|
|
|
206f5e |
rpc_createerr.cf_error.re_errno = ENOMEM;
|
|
|
206f5e |
free(auth);
|
|
|
206f5e |
+ free(gd);
|
|
|
206f5e |
return (NULL);
|
|
|
206f5e |
}
|
|
|
206f5e |
}
|
|
|
206f5e |
@@ -592,7 +593,7 @@ _rpc_gss_refresh(AUTH *auth, rpc_gss_options_ret_t *options_ret)
|
|
|
206f5e |
if (rpc_gss_oid_to_mech(actual_mech_type, &mechanism)) {
|
|
|
206f5e |
strncpy(options_ret->actual_mechanism,
|
|
|
206f5e |
mechanism,
|
|
|
206f5e |
- sizeof(options_ret->actual_mechanism));
|
|
|
206f5e |
+ (sizeof(options_ret->actual_mechanism)-1));
|
|
|
206f5e |
}
|
|
|
206f5e |
|
|
|
206f5e |
gd->established = TRUE;
|
|
|
206f5e |
diff --git a/src/clnt_bcast.c b/src/clnt_bcast.c
|
|
|
206f5e |
index 98cf061..2ad6c89 100644
|
|
|
206f5e |
--- a/src/clnt_bcast.c
|
|
|
206f5e |
+++ b/src/clnt_bcast.c
|
|
|
206f5e |
@@ -330,6 +330,7 @@ rpc_broadcast_exp(prog, vers, proc, xargs, argsp, xresults, resultsp,
|
|
|
206f5e |
if (nettype == NULL)
|
|
|
206f5e |
nettype = "datagram_n";
|
|
|
206f5e |
if ((handle = __rpc_setconf(nettype)) == NULL) {
|
|
|
206f5e |
+ AUTH_DESTROY(sys_auth);
|
|
|
206f5e |
return (RPC_UNKNOWNPROTO);
|
|
|
206f5e |
}
|
|
|
206f5e |
while ((nconf = __rpc_getconf(handle)) != NULL) {
|
|
|
206f5e |
diff --git a/src/getnetconfig.c b/src/getnetconfig.c
|
|
|
206f5e |
index 92e7c43..d67d97d 100644
|
|
|
206f5e |
--- a/src/getnetconfig.c
|
|
|
206f5e |
+++ b/src/getnetconfig.c
|
|
|
206f5e |
@@ -709,6 +709,8 @@ struct netconfig *ncp;
|
|
|
206f5e |
p->nc_lookups = (char **)malloc((size_t)(p->nc_nlookups+1) * sizeof(char *));
|
|
|
206f5e |
if (p->nc_lookups == NULL) {
|
|
|
206f5e |
free(p->nc_netid);
|
|
|
206f5e |
+ free(p);
|
|
|
206f5e |
+ free(tmp);
|
|
|
206f5e |
return(NULL);
|
|
|
206f5e |
}
|
|
|
206f5e |
for (i=0; i < p->nc_nlookups; i++) {
|
|
|
206f5e |
diff --git a/src/getnetpath.c b/src/getnetpath.c
|
|
|
206f5e |
index 7c19932..ea1a18c 100644
|
|
|
206f5e |
--- a/src/getnetpath.c
|
|
|
206f5e |
+++ b/src/getnetpath.c
|
|
|
206f5e |
@@ -88,6 +88,7 @@ setnetpath()
|
|
|
206f5e |
}
|
|
|
206f5e |
if ((np_sessionp->nc_handlep = setnetconfig()) == NULL) {
|
|
|
206f5e |
syslog (LOG_ERR, "rpc: failed to open " NETCONFIG);
|
|
|
206f5e |
+ free(np_sessionp);
|
|
|
206f5e |
return (NULL);
|
|
|
206f5e |
}
|
|
|
206f5e |
np_sessionp->valid = NP_VALID;
|
|
|
206f5e |
diff --git a/src/rpc_generic.c b/src/rpc_generic.c
|
|
|
206f5e |
index 589cbd5..51f36ac 100644
|
|
|
206f5e |
--- a/src/rpc_generic.c
|
|
|
206f5e |
+++ b/src/rpc_generic.c
|
|
|
206f5e |
@@ -319,6 +319,7 @@ __rpc_setconf(nettype)
|
|
|
206f5e |
handle->nflag = FALSE;
|
|
|
206f5e |
break;
|
|
|
206f5e |
default:
|
|
|
206f5e |
+ free(handle);
|
|
|
206f5e |
return (NULL);
|
|
|
206f5e |
}
|
|
|
206f5e |
|
|
|
206f5e |
diff --git a/src/rpc_soc.c b/src/rpc_soc.c
|
|
|
206f5e |
index 5a6eeb7..a85cb17 100644
|
|
|
206f5e |
--- a/src/rpc_soc.c
|
|
|
206f5e |
+++ b/src/rpc_soc.c
|
|
|
206f5e |
@@ -663,15 +663,17 @@ svcunix_create(sock, sendsize, recvsize, path)
|
|
|
206f5e |
strcmp(nconf->nc_protofmly, NC_LOOPBACK) == 0)
|
|
|
206f5e |
break;
|
|
|
206f5e |
}
|
|
|
206f5e |
- if (nconf == NULL)
|
|
|
206f5e |
+ if (nconf == NULL) {
|
|
|
206f5e |
+ endnetconfig(localhandle);
|
|
|
206f5e |
return(xprt);
|
|
|
206f5e |
+ }
|
|
|
206f5e |
|
|
|
206f5e |
if ((sock = __rpc_nconf2fd(nconf)) < 0)
|
|
|
206f5e |
goto done;
|
|
|
206f5e |
|
|
|
206f5e |
memset(&sun, 0, sizeof sun);
|
|
|
206f5e |
sun.sun_family = AF_LOCAL;
|
|
|
206f5e |
- strncpy(sun.sun_path, path, sizeof(sun.sun_path));
|
|
|
206f5e |
+ strncpy(sun.sun_path, path, (sizeof(sun.sun_path)-1));
|
|
|
206f5e |
addrlen = sizeof(struct sockaddr_un);
|
|
|
206f5e |
sa = (struct sockaddr *)&sun;
|
|
|
206f5e |
|
|
|
206f5e |
@@ -692,6 +694,8 @@ svcunix_create(sock, sendsize, recvsize, path)
|
|
|
206f5e |
}
|
|
|
206f5e |
|
|
|
206f5e |
xprt = (SVCXPRT *)svc_tli_create(sock, nconf, &taddr, sendsize, recvsize);
|
|
|
206f5e |
+ if (xprt == NULL)
|
|
|
206f5e |
+ close(sock);
|
|
|
206f5e |
|
|
|
206f5e |
done:
|
|
|
206f5e |
endnetconfig(localhandle);
|
|
|
206f5e |
diff --git a/src/rpcb_clnt.c b/src/rpcb_clnt.c
|
|
|
206f5e |
index e45736a..0c34cb7 100644
|
|
|
206f5e |
--- a/src/rpcb_clnt.c
|
|
|
206f5e |
+++ b/src/rpcb_clnt.c
|
|
|
206f5e |
@@ -547,6 +547,7 @@ try_nconf:
|
|
|
206f5e |
if (tmpnconf == NULL) {
|
|
|
206f5e |
rpc_createerr.cf_stat = RPC_UNKNOWNPROTO;
|
|
|
206f5e |
mutex_unlock(&loopnconf_lock);
|
|
|
206f5e |
+ endnetconfig(nc_handle);
|
|
|
206f5e |
return (NULL);
|
|
|
206f5e |
}
|
|
|
206f5e |
loopnconf = getnetconfigent(tmpnconf->nc_netid);
|
|
|
206f5e |
diff --git a/src/rtime.c b/src/rtime.c
|
|
|
206f5e |
index b642840..29fbf0a 100644
|
|
|
206f5e |
--- a/src/rtime.c
|
|
|
206f5e |
+++ b/src/rtime.c
|
|
|
206f5e |
@@ -90,6 +90,7 @@ rtime(addrp, timep, timeout)
|
|
|
206f5e |
|
|
|
206f5e |
/* TCP and UDP port are the same in this case */
|
|
|
206f5e |
if ((serv = getservbyname("time", "tcp")) == NULL) {
|
|
|
206f5e |
+ do_close(s);
|
|
|
206f5e |
return(-1);
|
|
|
206f5e |
}
|
|
|
206f5e |
|
|
|
206f5e |
diff --git a/src/svc_generic.c b/src/svc_generic.c
|
|
|
206f5e |
index 52a56c2..20abaa2 100644
|
|
|
206f5e |
--- a/src/svc_generic.c
|
|
|
206f5e |
+++ b/src/svc_generic.c
|
|
|
206f5e |
@@ -113,6 +113,7 @@ svc_create(dispatch, prognum, versnum, nettype)
|
|
|
206f5e |
if (l == NULL) {
|
|
|
206f5e |
warnx("svc_create: no memory");
|
|
|
206f5e |
mutex_unlock(&xprtlist_lock);
|
|
|
206f5e |
+ __rpc_endconf(handle);
|
|
|
206f5e |
return (0);
|
|
|
206f5e |
}
|
|
|
206f5e |
l->xprt = xprt;
|
|
|
206f5e |
diff --git a/src/svc_simple.c b/src/svc_simple.c
|
|
|
206f5e |
index cb58002..c32fe0a 100644
|
|
|
206f5e |
--- a/src/svc_simple.c
|
|
|
206f5e |
+++ b/src/svc_simple.c
|
|
|
206f5e |
@@ -157,6 +157,7 @@ rpc_reg(prognum, versnum, procnum, progname, inproc, outproc, nettype)
|
|
|
206f5e |
((netid = strdup(nconf->nc_netid)) == NULL)) {
|
|
|
206f5e |
warnx(rpc_reg_err, rpc_reg_msg, __no_mem_str);
|
|
|
206f5e |
SVC_DESTROY(svcxprt);
|
|
|
206f5e |
+ free(xdrbuf);
|
|
|
206f5e |
break;
|
|
|
206f5e |
}
|
|
|
206f5e |
madenow = TRUE;
|