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.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/box64context.c b/src/box64context.c
index ef5b6c54..1d940b39 100755
--- a/src/box64context.c
+++ b/src/box64context.c
@@ -154,6 +154,12 @@ box64context_t *NewBox64Context(int argc)
     // init and put default values
     box64context_t *context = my_context = (box64context_t*)calloc(1, sizeof(box64context_t));
 
+    if(cycle_log)
+        for(int i=0; i<CYCLE_LOG; ++i) {
+            context->log_call[i] = (char*)calloc(256, 1);
+            context->log_ret[i] = (char*)calloc(128, 1);
+        }
+
     context->deferedInit = 1;
     context->sel_serial = 1;
 
@@ -293,6 +299,12 @@ void FreeBox64Context(box64context_t** context)
     pthread_mutex_destroy(&ctx->mutex_thread);
     pthread_mutex_destroy(&ctx->mutex_bridge);
 
+    if(cycle_log)
+        for(int i=0; i<CYCLE_LOG; ++i) {
+            free(ctx->log_call[i]);
+            free(ctx->log_ret[i]);
+        }
+
     free(ctx);
 }