:: commit 3ce1415a3a8248c6bcebc83e250a1cd2b1f13291

mintsuki <mintsuki@protonmail.com> — 2024-06-04 00:11

parents: 54e8882328

lib/elf: Free allocated RELA structs for RELR

diff --git a/common/lib/elf.c b/common/lib/elf.c
index 60702b22..8aee6d8d 100644
--- a/common/lib/elf.c
+++ b/common/lib/elf.c
@@ -516,6 +516,9 @@ static bool elf64_apply_relocations(uint8_t *elf, struct elf64_hdr *hdr, void *b
         }
     }
 
+    for (size_t i = 0; i < relr_count; i++) {
+        pmm_free(relocs[i], sizeof(struct elf64_rela));
+    }
     pmm_free(relocs, relocs_i * sizeof(struct elf64_rela *));
 
     return true;
tab: 248 wrap: offon