]> CyberLeo.Net >> Repos - FreeBSD/stable/10.git/commit
MFC r300620,r300621:
authorngie <ngie@ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f>
Wed, 8 Jun 2016 13:58:47 +0000 (13:58 +0000)
committerngie <ngie@ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f>
Wed, 8 Jun 2016 13:58:47 +0000 (13:58 +0000)
commite9583b7b3606241b1ee5baed449757e17da0d234
tree679869299daa64600683a1ef36b6dc4a8c980568
parent7c52b0c909b29ed76f4001a9fbfdb3f0fc7cddec
MFC r300620,r300621:

r300620:

Use reallocf instead of malloc to fix leak with outbuf_pmap

The previous code overwrote outbuf_pmap's memory with malloc once per
loop iteration, which leaked its memory; use reallocf instead to ensure
that memory is properly free'd each loop iteration.

Add a outbuf_pmap = NULL in the failure case to avoid a double-free
at the bottom of the function.

CID: 1038776

r300621:

Remove redundant NULLing of outbuf_pmap

If reallocf ever failed, outbuf_pmap would already be NULL

git-svn-id: svn://svn.freebsd.org/base/stable/10@301622 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
lib/libc/rpc/clnt_bcast.c