diff options
| author | Arnaldo Carvalho de Melo <[email protected]> | 2020-05-13 10:20:26 -0300 |
|---|---|---|
| committer | Arnaldo Carvalho de Melo <[email protected]> | 2020-05-28 10:03:26 -0300 |
| commit | 7fcdccd4237724931d9773d1e3039bfe053a6f52 (patch) | |
| tree | 7313aa13d1217e6aefec59c62862afd6fda03229 /tools/perf/scripts/python/export-to-sqlite.py | |
| parent | e12a89ef73b227e9f56c41502aefcee59fd2a05b (diff) | |
perf parse-events: Fix incorrect conversion of 'if () free()' to 'zfree()'
When applying a patch by Ian I incorrectly converted to zfree() an
expression that involved testing some other struct member, not the one
being freed, which lead to bugs reproduceable by:
$ perf stat -e i/bs,tsc,L2/o sleep 1
WARNING: multiple event parsing errors
Segmentation fault (core dumped)
$
Fix it by restoring the test for pos->free_str before freeing
pos->val.str, but continue using zfree(&pos->val.str) to set that member
to NULL after freeing it.
Reported-by: Ian Rogers <[email protected]>
Fixes: e8dfb81838b1 ("perf parse-events: Fix memory leaks found on parse_events")
Cc: Adrian Hunter <[email protected]>
Cc: Alexander Shishkin <[email protected]>
Cc: Andi Kleen <[email protected]>
Cc: [email protected]
Cc: Jiri Olsa <[email protected]>
Cc: Leo Yan <[email protected]>
Cc: Mark Rutland <[email protected]>
Cc: Namhyung Kim <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Cc: Stephane Eranian <[email protected]>
Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
Diffstat (limited to 'tools/perf/scripts/python/export-to-sqlite.py')
0 files changed, 0 insertions, 0 deletions