readelf memory leak in process_mips_specific

* readelf.c (process_mips_specific): Free iconf on error path.
This commit is contained in:
Alan Modra 2020-03-24 12:12:24 +10:30
parent 1ce0847daa
commit 5a814d6d96
2 changed files with 12 additions and 2 deletions

View File

@ -1,3 +1,7 @@
2020-03-24 Alan Modra <amodra@gmail.com>
* readelf.c (process_mips_specific): Free iconf on error path.
2020-03-23 Nick Clifton <nickc@redhat.com>
PR 25714

View File

@ -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]);