diff options
author | Andrii Nakryiko <[email protected]> | 2020-07-09 18:10:23 -0700 |
---|---|---|
committer | Daniel Borkmann <[email protected]> | 2020-07-10 16:24:35 +0200 |
commit | 5c3320d7fece4612d4a413aa3c8e82cdb5b49fcb (patch) | |
tree | f3a1592c19c8d4b1502b06a352d598a24b498b82 /tools/testing/selftests/bpf/prog_tests/tcp_rtt.c | |
parent | 2977282b63c3b6f112145ecf0bcefff0c65bd3ac (diff) |
libbpf: Fix memory leak and optimize BTF sanitization
Coverity's static analysis helpfully reported a memory leak introduced by
0f0e55d8247c ("libbpf: Improve BTF sanitization handling"). While fixing it,
I realized that btf__new() already creates a memory copy, so there is no need
to do this. So this patch also fixes misleading btf__new() signature to make
data into a `const void *` input parameter. And it avoids unnecessary memory
allocation and copy in BTF sanitization code altogether.
Fixes: 0f0e55d8247c ("libbpf: Improve BTF sanitization handling")
Signed-off-by: Andrii Nakryiko <[email protected]>
Signed-off-by: Daniel Borkmann <[email protected]>
Link: https://lore.kernel.org/bpf/[email protected]
Diffstat (limited to 'tools/testing/selftests/bpf/prog_tests/tcp_rtt.c')
0 files changed, 0 insertions, 0 deletions