diff options
Diffstat (limited to 'src/libelfu/modelops')
-rw-r--r-- | src/libelfu/modelops/fromFile.c | 4 | ||||
-rw-r--r-- | src/libelfu/modelops/layout.c | 7 | ||||
-rw-r--r-- | src/libelfu/modelops/reladd.c | 2 |
3 files changed, 4 insertions, 9 deletions
diff --git a/src/libelfu/modelops/fromFile.c b/src/libelfu/modelops/fromFile.c index ef7add9..a4f0384 100644 --- a/src/libelfu/modelops/fromFile.c +++ b/src/libelfu/modelops/fromFile.c @@ -460,7 +460,9 @@ ElfuElf* elfu_mFromElf(Elf *e) } } - + if (secArray) { + free(secArray); + } return me; diff --git a/src/libelfu/modelops/layout.c b/src/libelfu/modelops/layout.c index 2fd610c..182ed2e 100644 --- a/src/libelfu/modelops/layout.c +++ b/src/libelfu/modelops/layout.c @@ -345,7 +345,6 @@ int elfu_mLayoutAuto(ElfuElf *me) ElfuPhdr *highestOffsEnd; ElfuPhdr *mp; ElfuScn *ms; - ElfuPhdr **phdrArr; GElf_Off lastend = 0; assert(me); @@ -354,12 +353,6 @@ int elfu_mLayoutAuto(ElfuElf *me) elfu_mPhdrLoadLowestHighest(me, &lowestAddr, &highestAddr, &lowestOffs, &highestOffsEnd); - phdrArr = malloc(elfu_mPhdrCount(me) * sizeof(*phdrArr)); - if (!phdrArr) { - ELFU_WARN("elfu_mLayoutAuto: malloc failed for phdrArr.\n"); - return 1; - } - lastend = OFFS_END(highestOffsEnd->phdr.p_offset, highestOffsEnd->phdr.p_filesz); diff --git a/src/libelfu/modelops/reladd.c b/src/libelfu/modelops/reladd.c index 1980c76..4bc6e40 100644 --- a/src/libelfu/modelops/reladd.c +++ b/src/libelfu/modelops/reladd.c @@ -130,7 +130,7 @@ static ElfuScn* insertSection(ElfuElf *me, ElfuElf *mrel, ElfuScn *oldscn) ERROR: if (newscn) { - // TODO: Destroy newscn + elfu_mScnDestroy(newscn); } return NULL; } |