summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authormbr <mbr@FreeBSD.org>2006-09-09 22:14:42 +0000
committermbr <mbr@FreeBSD.org>2006-09-09 22:14:42 +0000
commitbc9ee76c285172e3b91d231b9e49d1180c721ee0 (patch)
treeaa939b8d9f25f563a29110d0097f569c38cadfa1 /lib
parentecd9e77d3e390be599f5cc1767de85c967bcf755 (diff)
downloadFreeBSD-src-bc9ee76c285172e3b91d231b9e49d1180c721ee0.zip
FreeBSD-src-bc9ee76c285172e3b91d231b9e49d1180c721ee0.tar.gz
Sync with NetBSD rev. 1.16 + 1.17
Coverity CID 3651: Don't leak ifaddrs on getaddrinfo failure. Coverity CID 2283: Don't leak sys_auth on error. MFC after: 1 month
Diffstat (limited to 'lib')
-rw-r--r--lib/libc/rpc/clnt_bcast.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/libc/rpc/clnt_bcast.c b/lib/libc/rpc/clnt_bcast.c
index 5c48cf8..eef0ca5 100644
--- a/lib/libc/rpc/clnt_bcast.c
+++ b/lib/libc/rpc/clnt_bcast.c
@@ -141,8 +141,10 @@ __rpc_getbroadifs(int af, int proto, int socktype, broadlist_t *list)
hints.ai_protocol = proto;
hints.ai_socktype = socktype;
- if (getaddrinfo(NULL, "sunrpc", &hints, &res) != 0)
+ if (getaddrinfo(NULL, "sunrpc", &hints, &res) != 0) {
+ freeifaddrs(ifp);
return 0;
+ }
for (ifap = ifp; ifap != NULL; ifap = ifap->ifa_next) {
if (ifap->ifa_addr->sa_family != af ||
@@ -299,6 +301,7 @@ rpc_broadcast_exp(prog, vers, proc, xargs, argsp, xresults, resultsp,
if (nettype == NULL)
nettype = "datagram_n";
if ((handle = __rpc_setconf(nettype)) == NULL) {
+ AUTH_DESTROY(sys_auth);
return (RPC_UNKNOWNPROTO);
}
while ((nconf = __rpc_getconf(handle)) != NULL) {
OpenPOWER on IntegriCloud