Commit 4747395
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 <irogers@google.com>
Acked-by: Jiri Olsa <jolsa@redhat.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Stephane Eranian <eranian@google.com>
Link: http://lore.kernel.org/lkml/20211118201730.2302927-1-irogers@google.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>1 parent 1aa79e5 commit 4747395
1 file changed
Lines changed: 10 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2321 | 2321 | | |
2322 | 2322 | | |
2323 | 2323 | | |
| 2324 | + | |
2324 | 2325 | | |
2325 | 2326 | | |
2326 | 2327 | | |
| |||
4124 | 4125 | | |
4125 | 4126 | | |
4126 | 4127 | | |
| 4128 | + | |
4127 | 4129 | | |
4128 | 4130 | | |
4129 | 4131 | | |
| |||
4141 | 4143 | | |
4142 | 4144 | | |
4143 | 4145 | | |
4144 | | - | |
4145 | | - | |
| 4146 | + | |
| 4147 | + | |
| 4148 | + | |
| 4149 | + | |
4146 | 4150 | | |
4147 | 4151 | | |
4148 | | - | |
| 4152 | + | |
4149 | 4153 | | |
4150 | 4154 | | |
4151 | 4155 | | |
| |||
4154 | 4158 | | |
4155 | 4159 | | |
4156 | 4160 | | |
4157 | | - | |
4158 | | - | |
| 4161 | + | |
| 4162 | + | |
| 4163 | + | |
4159 | 4164 | | |
4160 | 4165 | | |
4161 | 4166 | | |
| |||
0 commit comments