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
This commit is contained in:
parent
b70cb0694b
commit
f1209420eb
@ -511,6 +511,7 @@ nis_rpcent(void *retval, void *mdata, va_list ap)
|
|||||||
sizeof(char *)) {
|
sizeof(char *)) {
|
||||||
*errnop = ERANGE;
|
*errnop = ERANGE;
|
||||||
rv = NS_RETURN;
|
rv = NS_RETURN;
|
||||||
|
free(resultbuf);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -520,6 +521,7 @@ nis_rpcent(void *retval, void *mdata, va_list ap)
|
|||||||
if (aliases_size < 1) {
|
if (aliases_size < 1) {
|
||||||
*errnop = ERANGE;
|
*errnop = ERANGE;
|
||||||
rv = NS_RETURN;
|
rv = NS_RETURN;
|
||||||
|
free(resultbuf);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user