]> git.ipfire.org Git - thirdparty/elfutils.git/commit
libelf: elf32_getshdr might leak section header when out of memory
authorMark Wielaard <mark@klomp.org>
Sat, 22 Jun 2024 23:09:29 +0000 (01:09 +0200)
committerMark Wielaard <mark@klomp.org>
Sat, 22 Jun 2024 23:09:39 +0000 (01:09 +0200)
commit563d9d8d12c123ad48fd55a5b0e17840f5e78080
tree215235b9130b5ba2d42d3c4c67a8802f487974ce
parent906b5edb8602f188218cc432481ed893644bc534
libelf: elf32_getshdr might leak section header when out of memory

Found by GCC -fanalyzer.

When allocating the notcvt buffer fails we leak the shdr. goto
free_and_out on malloc failure.

     * libelf/elf32_getshdr.c (load_shdr_wrlock): goto
             free_and_out on second malloc failure.

Signed-off-by: Mark Wielaard <mark@klomp.org>
libelf/elf32_getshdr.c