diff options
| author | Mark Wielaard <[email protected]> | 2019-03-06 19:56:54 +0100 |
|---|---|---|
| committer | Mark Wielaard <[email protected]> | 2019-03-06 19:56:54 +0100 |
| commit | 75e147d0ab85262d9bb2fff093db7ce67dbd4b62 (patch) | |
| tree | ed99c34b782365030e576497108a204197b812fa /libelf/elf32_updatefile.c | |
| parent | 142a51944db63f64d4839c65e904df48474dcb12 (diff) | |
libelf: Fix possible resource leak in elf[32|64]_updatefile.
When we cannot allocate enough memory to convert the data in
updatemmap we should free the scns before returning an error.
Signed-off-by: Mark Wielaard <[email protected]>
Diffstat (limited to 'libelf/elf32_updatefile.c')
| -rw-r--r-- | libelf/elf32_updatefile.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/libelf/elf32_updatefile.c b/libelf/elf32_updatefile.c index 2899c6fb..457d18e6 100644 --- a/libelf/elf32_updatefile.c +++ b/libelf/elf32_updatefile.c @@ -365,6 +365,7 @@ __elfw2(LIBELFBITS,updatemmap) (Elf *elf, int change_bo, size_t shnum) char *converted = aligned_alloc (align, size); if (converted == NULL) { + free (scns); __libelf_seterrno (ELF_E_NOMEM); return 1; } |
