diff options
author | Alan Modra <amodra@gmail.com> | 2023-02-08 23:49:46 +1030 |
---|---|---|
committer | Alan Modra <amodra@gmail.com> | 2023-02-09 09:40:51 +1030 |
commit | 389903128ac5686dc83efd121339158465614d67 (patch) | |
tree | 84d9758ff7d8f0cdd56e6403d40b63bffe99be47 /bfd | |
parent | 87d206578e152d81d903a0beec8bd3927154eb30 (diff) | |
download | gdb-389903128ac5686dc83efd121339158465614d67.zip gdb-389903128ac5686dc83efd121339158465614d67.tar.gz gdb-389903128ac5686dc83efd121339158465614d67.tar.bz2 |
Memory leak in bfd_init_section_compress_status
* compress.c (bfd_init_section_compress_status): Free
uncompressed_buffer on error return.
Diffstat (limited to 'bfd')
-rw-r--r-- | bfd/compress.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/bfd/compress.c b/bfd/compress.c index 2cf8a6c..2a402c3 100644 --- a/bfd/compress.c +++ b/bfd/compress.c @@ -1083,7 +1083,10 @@ bfd_init_section_compress_status (bfd *abfd, sec_ptr sec) if (!bfd_get_section_contents (abfd, sec, uncompressed_buffer, 0, uncompressed_size)) - return false; + { + free (uncompressed_buffer); + return false; + } sec->contents = uncompressed_buffer; if (bfd_compress_section_contents (abfd, sec) == 0) |