Memory leak in bfd_init_section_compress_status
Alan Modra
amodra@gmail.com
Wed Feb 8 23:13:36 GMT 2023
More information about the Binutils mailing list
Wed Feb 8 23:13:36 GMT 2023
- Previous message (by thread): Clear cached file size when bfd changed to BFD_IN_MEMORY
- Next message (by thread): coff-sh.c keep_relocs, keep_contents and keep_syms
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
* compress.c (bfd_init_section_compress_status): Free
uncompressed_buffer on error return.
diff --git a/bfd/compress.c b/bfd/compress.c
index 2cf8a6c28c9..2a402c3f65c 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)
--
Alan Modra
Australia Development Lab, IBM
- Previous message (by thread): Clear cached file size when bfd changed to BFD_IN_MEMORY
- Next message (by thread): coff-sh.c keep_relocs, keep_contents and keep_syms
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Binutils mailing list