Implement memory management TODOs
[centaur.git] / src / libelfu / modelops / layout.c
index 2fd610ce3b0808f6858854c0aca0666b3d5ac4d4..182ed2e4ec6d9e30339e13c4ceef0c854771a49d 100644 (file)
@@ -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);