1
mirror of https://github.com/DarkFlippers/unleashed-firmware.git synced 2025-12-12 04:34:43 +04:00

Loader: Fix BusFault in handling of OOM (#3992)

* Loader: Fix BusFault in handling of OOM
* Furi: fix crash in aligned_alloc, cleanup aligned_alloc use

Co-authored-by: あく <alleteam@gmail.com>
This commit is contained in:
WillyJL
2024-12-18 22:33:59 +01:00
committed by GitHub
parent 9c96bbfc54
commit a7b3a13581
2 changed files with 8 additions and 8 deletions

View File

@@ -8,11 +8,11 @@
#define TAG "Elf"
#define ELF_NAME_BUFFER_LEN 32
#define SECTION_OFFSET(e, n) ((e)->section_table + (n) * sizeof(Elf32_Shdr))
#define IS_FLAGS_SET(v, m) (((v) & (m)) == (m))
#define ELF_NAME_BUFFER_LEN 32
#define SECTION_OFFSET(e, n) ((e)->section_table + (n) * sizeof(Elf32_Shdr))
#define IS_FLAGS_SET(v, m) (((v) & (m)) == (m))
#define RESOLVER_THREAD_YIELD_STEP 30
#define FAST_RELOCATION_VERSION 1
#define FAST_RELOCATION_VERSION 1
// #define ELF_DEBUG_LOG 1
@@ -830,9 +830,7 @@ void elf_file_free(ELFFile* elf) {
for(ELFSectionDict_it(it, elf->sections); !ELFSectionDict_end_p(it);
ELFSectionDict_next(it)) {
const ELFSectionDict_itref_t* itref = ELFSectionDict_cref(it);
if(itref->value.data) {
aligned_free(itref->value.data);
}
aligned_free(itref->value.data);
if(itref->value.fast_rel) {
aligned_free(itref->value.fast_rel->data);
free(itref->value.fast_rel);