diff options
author | Enji Cooper <ngie@FreeBSD.org> | 2016-05-22 03:05:27 +0000 |
---|---|---|
committer | Enji Cooper <ngie@FreeBSD.org> | 2016-05-22 03:05:27 +0000 |
commit | f1209420ebfcd13773f96739a8c063f7477a9b48 (patch) | |
tree | 462695f33356532fd1864f8f3c69a266e00e83d5 /lib | |
parent | b70cb0694b18368625f22a94b106eaef6bacc92b (diff) | |
download | src-f1209420ebfcd13773f96739a8c063f7477a9b48.tar.gz src-f1209420ebfcd13773f96739a8c063f7477a9b48.zip |
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
Notes
Notes:
svn path=/head/; revision=300389
Diffstat (limited to 'lib')
-rw-r--r-- | lib/libc/rpc/getrpcent.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/libc/rpc/getrpcent.c b/lib/libc/rpc/getrpcent.c index 97457d37fc9b..e705af831d07 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; } |