Add Elf/Phdr/Scn alloc/destroy
[centaur.git] / src / libelfu / model / section.c
index c93c5c80b37114a9a3470bd803af553a9dfcbb83..9ef6fd8f342d89858f52326cbd399ddab83b82ec 100644 (file)
@@ -219,3 +219,16 @@ ElfuScn* elfu_mScnAlloc()
 
   return ms;
 }
+
+void elfu_mScnDestroy(ElfuScn* ms)
+{
+  assert(ms);
+
+  // TODO: Free symtab/reltab
+
+  if (ms->databuf) {
+    free(ms->databuf);
+  }
+
+  free(ms);
+}