diff options
| author | Andrii Nakryiko <[email protected]> | 2020-04-29 01:21:06 +0000 |
|---|---|---|
| committer | Alexei Starovoitov <[email protected]> | 2020-04-29 02:48:05 +0000 |
| commit | 9f56bb531a809ecaa7f0ddca61d2cf3adc1cb81a (patch) | |
| tree | 21da84b408cfb4672d905865373ce6749c4d94b5 | |
| parent | selftests/bpf: Fix memory leak in test selector (diff) | |
| download | kernel-9f56bb531a809ecaa7f0ddca61d2cf3adc1cb81a.tar.gz kernel-9f56bb531a809ecaa7f0ddca61d2cf3adc1cb81a.zip | |
selftests/bpf: Fix memory leak in extract_build_id()
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 <[email protected]>
Signed-off-by: Alexei Starovoitov <[email protected]>
Cc: Song Liu <[email protected]>
Link: https://lore.kernel.org/bpf/[email protected]
| -rw-r--r-- | tools/testing/selftests/bpf/test_progs.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/tools/testing/selftests/bpf/test_progs.c b/tools/testing/selftests/bpf/test_progs.c index 86d0020c9eec..93970ec1c9e9 100644 --- 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); |
