Message ID | 20231228215433.54854-6-rostedt@goodmis.org (mailing list archive) |
---|---|
State | Accepted |
Commit | 5159973ccb1a3b2f93d4f55729437fdbaf733ffc |
Headers | show |
Series | libtracefs: Several updates | expand |
diff --git a/src/tracefs-utils.c b/src/tracefs-utils.c index ef90677cf617..e67b698f5b99 100644 --- a/src/tracefs-utils.c +++ b/src/tracefs-utils.c @@ -248,7 +248,7 @@ static int test_dir(const char *dir, const char *file) */ const char *tracefs_tracing_dir(void) { - static const char *tracing_dir; + static char *tracing_dir; /* Do not check custom_tracing_dir */ if (custom_tracing_dir) @@ -257,6 +257,7 @@ const char *tracefs_tracing_dir(void) if (tracing_dir && test_dir(tracing_dir, "trace")) return tracing_dir; + free(tracing_dir); tracing_dir = find_tracing_dir(false, true); return tracing_dir; }