From: "Steven Rostedt (Google)" <rostedt@xxxxxxxxxxx> The "out_free" path frees the synth->dyn_event if new_event is set, but it is also freed in the success path (that falls through into the out_free path). The only reason this did not crash is because both cases set the "synth->dyn_event" to NULL, where the second attempt to free it does nothing. But this is still a bug. Fixes: d7c5dbb7a231e ("libtracefs: Use the internal dynamic events API when creating synthetic events") Signed-off-by: Steven Rostedt (Google) <rostedt@xxxxxxxxxxx> --- src/tracefs-hist.c | 5 ----- 1 file changed, 5 deletions(-) diff --git a/src/tracefs-hist.c b/src/tracefs-hist.c index 6f7d657bd404..302b9a75e6ee 100644 --- a/src/tracefs-hist.c +++ b/src/tracefs-hist.c @@ -2311,11 +2311,6 @@ int tracefs_synth_echo_cmd(struct trace_seq *seq, hist, path, synth->end_event->system, synth->end_event->name); - if (new_event) { - tracefs_dynevent_free(synth->dyn_event); - synth->dyn_event = NULL; - } - ret = 0; out_free: free(hist); -- 2.35.1