summaryrefslogtreecommitdiffstats
path: root/tools/perf/builtin-record.c
diff options
context:
space:
mode:
Diffstat (limited to 'tools/perf/builtin-record.c')
-rw-r--r--tools/perf/builtin-record.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/tools/perf/builtin-record.c b/tools/perf/builtin-record.c
index 2a85205ba01..82260c56db3 100644
--- a/tools/perf/builtin-record.c
+++ b/tools/perf/builtin-record.c
@@ -439,6 +439,11 @@ static int __cmd_record(int argc, const char **argv)
else
header = perf_header__new();
+ if (header == NULL) {
+ pr_err("Not enough memory for reading perf file header\n");
+ return -1;
+ }
+
if (raw_samples) {
perf_header__set_feat(header, HEADER_TRACE_INFO);
} else {