@@ -443,6 +443,9 @@ void metricgroup__print(bool metrics, bool metricgroups, char *filter,
continue;
strlist__add(me->metrics, s);
}
+
+ if (!raw)
+ free(s);
}
free(omg);
}
@@ -726,7 +729,7 @@ int metricgroup__parse_groups(const struct option *opt,
ret = metricgroup__add_metric_list(str, metric_no_group,
&extra_events, &group_list);
if (ret)
- return ret;
+ goto out;
pr_debug("adding %s\n", extra_events.buf);
bzero(&parse_error, sizeof(parse_error));
ret = parse_events(perf_evlist, extra_events.buf, &parse_error);
@@ -734,11 +737,11 @@ int metricgroup__parse_groups(const struct option *opt,
parse_events_print_error(&parse_error, extra_events.buf);
goto out;
}
- strbuf_release(&extra_events);
ret = metricgroup__setup_events(&group_list, metric_no_merge,
perf_evlist, metric_events);
out:
metricgroup__free_egroups(&group_list);
+ strbuf_release(&extra_events);
return ret;
}