From 8adfbf41ce02a0af75d5a8628c48070293e2192a Mon Sep 17 00:00:00 2001 From: Sebastian Reimers Date: Wed, 27 Sep 2023 17:04:07 +0200 Subject: [PATCH] trace: check for already initialized trace --- src/trace/trace.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/trace/trace.c b/src/trace/trace.c index 884af188b..472aeeea7 100644 --- a/src/trace/trace.c +++ b/src/trace/trace.c @@ -108,6 +108,9 @@ int re_trace_init(const char *json_file) if (!json_file) return EINVAL; + if (trace.init) + return EALREADY; + trace.event_buffer = mem_zalloc( TRACE_BUFFER_SIZE * sizeof(struct trace_event), NULL); if (!trace.event_buffer)