Em Wed, Apr 26, 2017 at 09:21:03PM +0900, Taeung Song escreveu:
If existent config files contains nothing,<SNIP>
the sections list in config_set can be empty.
So check not only NULL pointer of config_set but
also the list in config_set.
+++ b/tools/perf/builtin-config.c
@@ -75,7 +75,7 @@ static int show_spec_config(struct perf_config_set *set, const char *var)
struct perf_config_section *section;
struct perf_config_item *item;
- if (set == NULL)
+ if (set == NULL || list_empty(&set->sections))
return -1;
But should we consider an error to have an empty config file? I don't
think so :-\
- Arnaldo