diff options
author | ngie <ngie@FreeBSD.org> | 2016-06-08 13:58:47 +0000 |
---|---|---|
committer | ngie <ngie@FreeBSD.org> | 2016-06-08 13:58:47 +0000 |
commit | 4d9deb28d571e6b89bd3fc5310ab1aa153baa237 (patch) | |
tree | 679869299daa64600683a1ef36b6dc4a8c980568 /lib/libc/stdlib | |
parent | 1e9eae959ce6f13ac755c2da7b1631ee5578b6d7 (diff) | |
download | FreeBSD-src-4d9deb28d571e6b89bd3fc5310ab1aa153baa237.zip FreeBSD-src-4d9deb28d571e6b89bd3fc5310ab1aa153baa237.tar.gz |
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
Diffstat (limited to 'lib/libc/stdlib')
0 files changed, 0 insertions, 0 deletions