aboutsummaryrefslogtreecommitdiffstats
path: root/tools/testing/selftests/bpf/trace_helpers.c
diff options
context:
space:
mode:
authorPeng Hao <peng.hao2@zte.com.cn>2018-10-18 23:18:36 +0800
committerDaniel Borkmann <daniel@iogearbox.net>2018-10-18 22:13:30 +0200
commit1bd70d2eba9d90eb787634361f0f6fa2c86b3f6d (patch)
tree5eca2ab361355d186492b1f8e4a189e7cc7ccc36 /tools/testing/selftests/bpf/trace_helpers.c
parentbpf: fix doc of bpf_skb_adjust_room() in uapi (diff)
downloadlinux-dev-1bd70d2eba9d90eb787634361f0f6fa2c86b3f6d.tar.xz
linux-dev-1bd70d2eba9d90eb787634361f0f6fa2c86b3f6d.zip
selftests/bpf: fix file resource leak in load_kallsyms
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>
Diffstat (limited to 'tools/testing/selftests/bpf/trace_helpers.c')
-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 cabe2a3a3b30..a3d1dace4a75 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;