Skip to content

Commit

Permalink
trace: check for already initialized trace
Browse files Browse the repository at this point in the history
  • Loading branch information
sreimers committed Sep 27, 2023
1 parent 29bd60b commit 8adfbf4
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/trace/trace.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 8adfbf4

Please sign in to comment.