diff --git a/tools/perf/util/data.c b/tools/perf/util/data.c index 5d97b3e45fbb..bcb494dc816a 100644 --- a/tools/perf/util/data.c +++ b/tools/perf/util/data.c @@ -20,7 +20,7 @@ static void close_dir(struct perf_data_file *files, int nr) { - while (--nr >= 1) { + while (--nr >= 0) { close(files[nr].fd); zfree(&files[nr].path); }