diff --git a/tools/perf/builtin-stat.c b/tools/perf/builtin-stat.c index 89e80a3bc9c32a5baaf5f4027e9644f5092cc7c7..1f8a23a1b867f49a6efbf363b9dea7f1bea18c88 100644 --- a/tools/perf/builtin-stat.c +++ b/tools/perf/builtin-stat.c @@ -768,6 +768,7 @@ static int __run_perf_stat(int argc, const char **argv, int run_idx) switch (stat_handle_error(counter)) { case COUNTER_FATAL: + affinity__cleanup(&affinity); return -1; case COUNTER_RETRY: goto try_again; @@ -813,6 +814,7 @@ static int __run_perf_stat(int argc, const char **argv, int run_idx) switch (stat_handle_error(counter)) { case COUNTER_FATAL: + affinity__cleanup(&affinity); return -1; case COUNTER_RETRY: goto try_again_reset; diff --git a/tools/perf/util/parse-events.c b/tools/perf/util/parse-events.c index 64d148f6032c56bfaca4d4c8cb48dc372d514c80..722aaf7a40c8f6411fa0e815dd2e34d54c487e8d 100644 --- a/tools/perf/util/parse-events.c +++ b/tools/perf/util/parse-events.c @@ -2637,13 +2637,12 @@ void print_sdt_events(const char *subsys_glob, const char *event_glob, struct probe_cache *pcache; struct probe_cache_entry *ent; struct strlist *bidlist, *sdtlist; - struct strlist_config cfg = {.dont_dupstr = true}; - struct str_node *nd, *nd2; char *buf, *path, *ptr = NULL; + struct str_node *nd, *nd2; bool show_detail = false; int ret; - sdtlist = strlist__new(NULL, &cfg); + sdtlist = strlist__new(NULL, NULL); if (!sdtlist) { pr_debug("Failed to allocate new strlist for SDT\n"); return; @@ -2670,6 +2669,8 @@ void print_sdt_events(const char *subsys_glob, const char *event_glob, ent->pev.event, nd->s); if (ret > 0) strlist__add(sdtlist, buf); + + free(buf); } probe_cache__delete(pcache); }