From: Alan Modra Date: Tue, 24 Mar 2020 01:42:24 +0000 (+1030) Subject: readelf memory leak in process_mips_specific X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=5a814d6d96bc6426ae1fa8b0d1561ad081deb159;p=binutils-gdb.git readelf memory leak in process_mips_specific * readelf.c (process_mips_specific): Free iconf on error path. --- diff --git a/binutils/ChangeLog b/binutils/ChangeLog index bad19ea8b29..11be80dfc30 100644 --- a/binutils/ChangeLog +++ b/binutils/ChangeLog @@ -1,3 +1,7 @@ +2020-03-24 Alan Modra + + * readelf.c (process_mips_specific): Free iconf on error path. + 2020-03-23 Nick Clifton PR 25714 diff --git a/binutils/readelf.c b/binutils/readelf.c index 61f06176835..1f0f49222fd 100644 --- a/binutils/readelf.c +++ b/binutils/readelf.c @@ -17074,7 +17074,10 @@ process_mips_specific (Filedata * filedata) get_data (NULL, filedata, conflicts_offset, sizeof (*econf32), conflictsno, _("conflict")); if (!econf32) - return FALSE; + { + free (iconf); + return FALSE; + } for (cnt = 0; cnt < conflictsno; ++cnt) iconf[cnt] = BYTE_GET (econf32[cnt]); @@ -17089,7 +17092,10 @@ process_mips_specific (Filedata * filedata) get_data (NULL, filedata, conflicts_offset, sizeof (*econf64), conflictsno, _("conflict")); if (!econf64) - return FALSE; + { + free (iconf); + return FALSE; + } for (cnt = 0; cnt < conflictsno; ++cnt) iconf[cnt] = BYTE_GET (econf64[cnt]);