diff options
Diffstat (limited to 'src/libelfu/modelops/fromFile.c')
-rw-r--r-- | src/libelfu/modelops/fromFile.c | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/src/libelfu/modelops/fromFile.c b/src/libelfu/modelops/fromFile.c index 9671b5f..e19df7b 100644 --- a/src/libelfu/modelops/fromFile.c +++ b/src/libelfu/modelops/fromFile.c @@ -290,19 +290,11 @@ ElfuElf* elfu_mFromElf(Elf *e) goto ERROR; } - me = malloc(sizeof(ElfuElf)); + me = elfu_mElfAlloc(); if (!me) { - ELFU_WARN("elfu_mFromElf: malloc() failed for ElfuElf.\n"); goto ERROR; } - - /* General stuff */ - CIRCLEQ_INIT(&me->phdrList); - CIRCLEQ_INIT(&me->orphanScnList); - me->shstrtab = NULL; - me->symtab = NULL; - me->elfclass = gelf_getclass(e); assert(me->elfclass != ELFCLASSNONE); assert(gelf_getehdr(e, &me->ehdr) == &me->ehdr); @@ -473,7 +465,7 @@ ElfuElf* elfu_mFromElf(Elf *e) free(secArray); } if (me) { - // TODO: Free data structures + elfu_mElfDestroy(me); } ELFU_WARN("elfu_mFromElf: Failed to load file.\n"); |