readelf: Don't leak lengths array when detecting an invalid hash chain.
authorMark Wielaard <mark@klomp.org>
Tue, 5 Jun 2018 19:52:46 +0000 (21:52 +0200)
committerMark Wielaard <mark@klomp.org>
Fri, 8 Jun 2018 10:03:14 +0000 (12:03 +0200)
commit50478b80cede080891996cf080581ca2a0611ce8
treed41987bb7431d22e4b8b914714aceec8516c9c5a
parent0393dccf9a346c9ecd8753bcbe0b31f8a1edbe5b
readelf: Don't leak lengths array when detecting an invalid hash chain.

In both handle_sysv_hash and handle_sysv_hash64 we check the has chain
isn't too long. If it is we would report an error and leak the lengths
array. Just clean up the array even in the error case.

Signed-off-by: Mark Wielaard <mark@klomp.org>
src/ChangeLog
src/readelf.c