Use bfd_alloc for compressed section contents
authorH.J. Lu <hjl.tools@gmail.com>
Fri, 10 Apr 2015 10:54:41 +0000 (03:54 -0700)
committerH.J. Lu <hjl.tools@gmail.com>
Fri, 10 Apr 2015 10:54:41 +0000 (03:54 -0700)
commit030aeb759908d7bcf1b87f3599bfa482a90ab6c1
treebdd89dc7555aeaa5b5d18e43356918b2ac5d9bb7
parent8f572e5c0f71fd6641768985855b2e0955a78f51
Use bfd_alloc for compressed section contents

Compressed section contents should be bfd_alloced to avoid memory leak.
This patch replaces bfd_malloc and free with bfd_alloc and bfd_release
on compressed buffer in bfd_compress_section_contents.  There is still
a very small memory leak when compressed section isn't smaller.

* compress.c (bfd_compress_section_contents): Replace bfd_malloc
and free with bfd_alloc and bfd_release on compressed buffer.
Release buffer if compressed section isn't smaller.
bfd/ChangeLog
bfd/compress.c
This page took 0.028069 seconds and 4 git commands to generate.