In __add_all_instances(), name is allocated by strdup(dent->d_name) but is never freed. Anyway, the content of *name is copied in append_file() and allocate_instance(), so it didn't need to be strduped to begin with. Fixes a RESOURCE_LEAK error (CWE-772) Signed-off-by: Jerome Marchand <jmarchan@xxxxxxxxxx> --- tracecmd/trace-record.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tracecmd/trace-record.c b/tracecmd/trace-record.c index c4d43469..a9e5e64d 100644 --- a/tracecmd/trace-record.c +++ b/tracecmd/trace-record.c @@ -422,7 +422,7 @@ static int __add_all_instances(const char *tracing_dir) } while ((dent = readdir(dir))) { - const char *name = strdup(dent->d_name); + const char *name = dent->d_name; char *instance_path; struct buffer_instance *instance; -- 2.44.0