aboutsummaryrefslogtreecommitdiffstats
path: root/src/vlibapi
diff options
context:
space:
mode:
Diffstat (limited to 'src/vlibapi')
-rw-r--r--src/vlibapi/api_shared.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/vlibapi/api_shared.c b/src/vlibapi/api_shared.c
index cee9cd54f5f..77a18c9e73c 100644
--- a/src/vlibapi/api_shared.c
+++ b/src/vlibapi/api_shared.c
@@ -97,7 +97,9 @@ vl_msg_api_trace (api_main_t * am, vl_api_trace_t * tp, void *msg)
old_trace = tp->traces + tp->curindex++;
if (tp->curindex == tp->nitems)
tp->curindex = 0;
- vec_free (*old_trace);
+ /* Reuse the trace record, may save some memory allocator traffic */
+ msg_copy = *old_trace;
+ vec_reset_length (msg_copy);
this_trace = old_trace;
}