about summary refs log tree commit diff stats
path: root/src/box64context.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/box64context.c')
-rwxr-xr-xsrc/box64context.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/box64context.c b/src/box64context.c
index 91aa4fbc..f020191e 100755
--- a/src/box64context.c
+++ b/src/box64context.c
@@ -129,16 +129,16 @@ void FreeBox64Context(box64context_t** context)
 
     box64context_t* ctx = *context;   // local copy to do the cleanning
 
+    if(ctx->local_maplib)
+        FreeLibrarian(&ctx->local_maplib, NULL);
+    if(ctx->maplib)
+        FreeLibrarian(&ctx->maplib, NULL);
+
     for(int i=0; i<ctx->elfsize; ++i) {
         FreeElfHeader(&ctx->elfs[i]);
     }
     free(ctx->elfs);
 
-    if(ctx->maplib)
-        FreeLibrarian(&ctx->maplib);
-    if(ctx->local_maplib)
-        FreeLibrarian(&ctx->local_maplib);
-
     FreeCollection(&ctx->box64_path);
     FreeCollection(&ctx->box64_ld_lib);
     FreeCollection(&ctx->box64_emulated_libs);