summaryrefslogtreecommitdiffstats
path: root/lib/libc/rpc/getrpcent.c
diff options
context:
space:
mode:
authorngie <ngie@FreeBSD.org>2016-05-22 03:05:27 +0000
committerngie <ngie@FreeBSD.org>2016-05-22 03:05:27 +0000
commit656dc0f01807be93c1ce9a1b1d93d2bc305c370b (patch)
tree462695f33356532fd1864f8f3c69a266e00e83d5 /lib/libc/rpc/getrpcent.c
parent526c7b961f0343da8ce288c1f2b3b734cec34ca4 (diff)
downloadFreeBSD-src-656dc0f01807be93c1ce9a1b1d93d2bc305c370b.zip
FreeBSD-src-656dc0f01807be93c1ce9a1b1d93d2bc305c370b.tar.gz
nis_rpcent: don't leak resultbuf from yp_first(..)/yp_next(..)
If the buffer couldn't be adequately resized to accomodate an additional "\n", it would leak resultbuf by breaking from the loop early MFC after: 2 weeks Reported by: Coverity CID: 1016702 Sponsored by: EMC / Isilon Storage Division
Diffstat (limited to 'lib/libc/rpc/getrpcent.c')
-rw-r--r--lib/libc/rpc/getrpcent.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/libc/rpc/getrpcent.c b/lib/libc/rpc/getrpcent.c
index 97457d3..e705af8 100644
--- a/lib/libc/rpc/getrpcent.c
+++ b/lib/libc/rpc/getrpcent.c
@@ -511,6 +511,7 @@ nis_rpcent(void *retval, void *mdata, va_list ap)
sizeof(char *)) {
*errnop = ERANGE;
rv = NS_RETURN;
+ free(resultbuf);
break;
}
@@ -520,6 +521,7 @@ nis_rpcent(void *retval, void *mdata, va_list ap)
if (aliases_size < 1) {
*errnop = ERANGE;
rv = NS_RETURN;
+ free(resultbuf);
break;
}
OpenPOWER on IntegriCloud