diff --git a/tools/perf/builtin-report.c b/tools/perf/builtin-report.c index 6400615b5e98..500f9d8902e7 100644 --- a/tools/perf/builtin-report.c +++ b/tools/perf/builtin-report.c @@ -143,6 +143,10 @@ static int report__config(const char *var, const char *value, void *cb) if (!strcmp(var, "report.sort_order")) { default_sort_order = strdup(value); + if (!default_sort_order) { + pr_err("Not enough memory for report.sort_order\n"); + return -1; + } return 0; } @@ -151,6 +155,7 @@ static int report__config(const char *var, const char *value, void *cb) return 0; } + pr_debug("%s variable unknown, ignoring...", var); return 0; }