perf header: Fix memory leaks when processing feature headers
These leaks were found with leak sanitizer running "perf pipe recording
and injection test".
In pipe mode feat_fd may hold onto an events struct that needs freeing.
When string features are processed they may overwrite an already created
string, so free this before the overwrite.
Signed-off-by: Ian Rogers <firstname.lastname@example.org>
Acked-by: Jiri Olsa <email@example.com>
Cc: Alexander Shishkin <firstname.lastname@example.org>
Cc: Mark Rutland <email@example.com>
Cc: Namhyung Kim <firstname.lastname@example.org>
Cc: Peter Zijlstra <email@example.com>
Cc: Stephane Eranian <firstname.lastname@example.org>
Signed-off-by: Arnaldo Carvalho de Melo <email@example.com>
1 file changed