diff --git a/binutils/ChangeLog b/binutils/ChangeLog index f099429d9b..0e3ae10c8a 100644 --- a/binutils/ChangeLog +++ b/binutils/ChangeLog @@ -1,3 +1,8 @@ +2021-01-15 Alan Modra + + PR 26539 + * readelf.c (uncompress_section_contents): Always call inflateEnd. + 2021-01-14 Alexandre Oliva * MAINTAINERS: Update my email address. diff --git a/binutils/readelf.c b/binutils/readelf.c index ad16b4571c..d828d5636d 100644 --- a/binutils/readelf.c +++ b/binutils/readelf.c @@ -14221,15 +14221,15 @@ uncompress_section_contents (unsigned char ** buffer, while (strm.avail_in > 0) { if (rc != Z_OK) - goto fail; + break; strm.next_out = ((Bytef *) uncompressed_buffer + (uncompressed_size - strm.avail_out)); rc = inflate (&strm, Z_FINISH); if (rc != Z_STREAM_END) - goto fail; + break; rc = inflateReset (& strm); } - rc = inflateEnd (& strm); + rc |= inflateEnd (& strm); if (rc != Z_OK || strm.avail_out != 0) goto fail;