about summary refs log tree commit diff stats
path: root/src/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/main.c')
-rwxr-xr-xsrc/main.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/main.c b/src/main.c
index c049a27d..1e513351 100755
--- a/src/main.c
+++ b/src/main.c
@@ -750,6 +750,17 @@ int main(int argc, const char **argv, const char **env) {
         FreeCollection(&ld_preload);
         return -1;
     }
+    // Load elf into memory
+    if(LoadElfMemory(f, my_context, elf_header)) {
+        printf_log(LOG_NONE, "Error: loading in memory elf %s\n", my_context->argv[0]);
+        fclose(f);
+        free_contextargv();
+        FreeBox64Context(&my_context);
+        FreeCollection(&ld_preload);
+        return -1;
+    }
+    // can close the file now
+    fclose(f);
 
 
     return 0;