diff --git a/tools/perf/util/header.c b/tools/perf/util/header.c index 9e2dce70b130..eaeeba8d65ec 100644 --- a/tools/perf/util/header.c +++ b/tools/perf/util/header.c @@ -4314,9 +4314,10 @@ size_t perf_event__fprintf_event_update(union perf_event *event, FILE *fp) ret += fprintf(fp, "... "); map = cpu_map__new_data(&ev->cpus.cpus); - if (map) + if (map) { ret += cpu_map__fprintf(map, fp); - else + perf_cpu_map__put(map); + } else ret += fprintf(fp, "failed to get cpus\n"); break; default: