projects
/
linux.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
f25d541
)
selftests/bpf: Fix memory leak in extract_build_id()
author
Andrii Nakryiko
<andriin@fb.com>
Wed, 29 Apr 2020 01:21:06 +0000
(18:21 -0700)
committer
Alexei Starovoitov
<ast@kernel.org>
Wed, 29 Apr 2020 02:48:05 +0000
(19:48 -0700)
getline() allocates string, which has to be freed.
Fixes: 81f77fd0deeb ("bpf: add selftest for stackmap with BPF_F_STACK_BUILD_ID")
Signed-off-by: Andrii Nakryiko <andriin@fb.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Cc: Song Liu <songliubraving@fb.com>
Link:
https://lore.kernel.org/bpf/20200429012111.277390-7-andriin@fb.com
tools/testing/selftests/bpf/test_progs.c
patch
|
blob
|
history
diff --git
a/tools/testing/selftests/bpf/test_progs.c
b/tools/testing/selftests/bpf/test_progs.c
index 86d0020c9eec18a639d01e6be9d12d0ee841ff95..93970ec1c9e942720e37c3adb9deecb3442925f1 100644
(file)
--- a/
tools/testing/selftests/bpf/test_progs.c
+++ b/
tools/testing/selftests/bpf/test_progs.c
@@
-351,6
+351,7
@@
int extract_build_id(char *build_id, size_t size)
len = size;
memcpy(build_id, line, len);
build_id[len] = '\0';
+ free(line);
return 0;
err:
fclose(fp);