gresources: fix memory leak from libelf

Memory was leaking when allocating it inside libelf and losing the pointer to it (it was an automatic variable) when returning NULL from the get_elf function in some cases

Closes #3242

Signed-off-by: Maxim Moskalets <Maxim.Moskalets@kaspersky.com>
This commit is contained in:
Maxim Moskalets 2024-02-03 15:16:56 +03:00
parent 3f4e6ddcd8
commit aa8ed92fba

View File

@ -165,6 +165,7 @@ get_elf (const gchar *file,
if (elf_kind (elf) != ELF_K_ELF)
{
elf_end (elf);
g_close (*fd, NULL);
*fd = -1;
return NULL;