Loading
perf parse-events: Fix one memory leakage issue
driver inclusion category: bugfix bugzilla: https://gitee.com/openeuler/kernel/issues/I8MEWF CVE: NA -------------------------------- ASan complains one memory leakage issue: ==2266938==ERROR: LeakSanitizer: detected memory leaks Direct leak of 14821 byte(s) in 217 object(s) allocated from: #0 0xffff96712468 in realloc (libasan.so.6+0xa5468) #1 0xffff956b0dac (/usr/lib64/libc.so.6+0x73dac) #2 0xffff9573097c in __asprintf_chk (/usr/lib64/libc.so.6+0xf397c) #3 0x4de620 in asprintf usr/include/aarch64-linux-gnu/bits/stdio2.h:178 #4 0x4de620 in print_sdt_events util/parse-events.c:2669 #5 0x4432e0 in cmd_list work/tools/perf/builtin-list.c:87 #6 0x4b85c4 in run_builtin work/tools/perf/perf.c:312 #7 0x431a90 in handle_internal_command work/tools/perf/perf.c:364 #8 0x431a90 in run_argv work/tools/perf/perf.c:408 #9 0x431a90 in main work/tools/perf/perf.c:538 #10 0xffff95667ff8 (/usr/lib64/libc.so.6+0x2aff8) #11 0xffff956680c4 in __libc_start_main (/usr/lib64/libc.so.6+0x2b0c4) #12 0x431d3c (/tmp/perf_asan+0x431d3c) SUMMARY: AddressSanitizer: 14821 byte(s) leaked in 217 allocation(s). Fix this. Fixes: 40218dae ("perf list: Show SDT and pre-cached events") Signed-off-by:Yicong Yang <yangyicong@hisilicon.com> Signed-off-by:
Junhao He <hejunhao3@huawei.com>