Free file handle after elf load

This commit is contained in:
Willy-JL
2023-05-28 00:25:42 +01:00
parent acf185ecb1
commit d325a1a43e

View File

@@ -652,7 +652,9 @@ void elf_file_free(ELFFile* elf) {
free(elf->debug_link_info.debug_link);
}
storage_file_free(elf->fd);
if(elf->fd != NULL) {
storage_file_free(elf->fd);
}
free(elf);
}
@@ -783,6 +785,9 @@ ELFFileLoadStatus elf_file_load_sections(ELFFile* elf) {
FURI_LOG_I(TAG, "Total size of loaded sections: %u", total_size); //-V576
}
storage_file_free(elf->fd);
elf->fd = NULL;
return status;
}