summaryrefslogtreecommitdiff
path: root/tools/testing
diff options
context:
space:
mode:
authorPeng Hao <peng.hao2@zte.com.cn>2018-10-18 23:18:36 +0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2019-12-01 09:16:40 +0100
commita0ec7f6eabe88eb72acfef786c706c453fef6872 (patch)
tree6d87dd8a5675c30baa39d529abef776735d3e8d9 /tools/testing
parent56b8b18321223aa3574856f17457539e8c117726 (diff)
selftests/bpf: fix file resource leak in load_kallsyms
[ Upstream commit 1bd70d2eba9d90eb787634361f0f6fa2c86b3f6d ] FILE pointer variable f is opened but never closed. Signed-off-by: Peng Hao <peng.hao2@zte.com.cn> Signed-off-by: Daniel Borkmann <daniel@iogearbox.net> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'tools/testing')
-rw-r--r--tools/testing/selftests/bpf/trace_helpers.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/tools/testing/selftests/bpf/trace_helpers.c b/tools/testing/selftests/bpf/trace_helpers.c
index cf156b353679..82922f13dcd3 100644
--- a/tools/testing/selftests/bpf/trace_helpers.c
+++ b/tools/testing/selftests/bpf/trace_helpers.c
@@ -41,6 +41,7 @@ int load_kallsyms(void)
syms[i].name = strdup(func);
i++;
}
+ fclose(f);
sym_cnt = i;
qsort(syms, sym_cnt, sizeof(struct ksym), ksym_cmp);
return 0;