From 67d004eb5fb3d4b79dda53866b4a70983cd7ed06 Mon Sep 17 00:00:00 2001 From: Tom Tromey Date: Fri, 19 Oct 2012 16:59:57 +0000 Subject: * compress.c: Revert previous patch. --- bfd/compress.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'bfd/compress.c') diff --git a/bfd/compress.c b/bfd/compress.c index 34faa08..17b5928 100644 --- a/bfd/compress.c +++ b/bfd/compress.c @@ -165,6 +165,7 @@ bfd_get_full_section_contents (bfd *abfd, sec_ptr sec, bfd_byte **ptr) bfd_size_type uncompressed_size; bfd_size_type rawsize; bfd_byte *compressed_buffer; + bfd_byte *uncompressed_buffer; #endif if (abfd->direction != write_direction && sec->rawsize != 0) @@ -219,24 +220,24 @@ bfd_get_full_section_contents (bfd *abfd, sec_ptr sec, bfd_byte **ptr) if (!ret) goto fail_compressed; - if (p == NULL) - p = (bfd_byte *) bfd_malloc (uncompressed_size); - if (p == NULL) + uncompressed_buffer = (bfd_byte *) bfd_malloc (uncompressed_size); + if (uncompressed_buffer == NULL) goto fail_compressed; if (!decompress_contents (compressed_buffer, compressed_size, - p, uncompressed_size)) + uncompressed_buffer, uncompressed_size)) { bfd_set_error (bfd_error_bad_value); - free (p); + free (uncompressed_buffer); fail_compressed: free (compressed_buffer); return FALSE; } free (compressed_buffer); - *ptr = p; - return TRUE; + sec->contents = uncompressed_buffer; + sec->compress_status = COMPRESS_SECTION_DONE; + /* Fall thru */ #endif case COMPRESS_SECTION_DONE: -- cgit v1.1