summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorPeng Hao <peng.hao2@zte.com.cn>2018-10-18 18:18:36 +0300
committerDaniel Borkmann <daniel@iogearbox.net>2018-10-18 23:13:30 +0300
commit1bd70d2eba9d90eb787634361f0f6fa2c86b3f6d (patch)
tree5eca2ab361355d186492b1f8e4a189e7cc7ccc36 /tools
parentb55cbc8d9b44aaee94f19e995a5f241d453763ee (diff)
downloadlinux-1bd70d2eba9d90eb787634361f0f6fa2c86b3f6d.tar.xz
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')
-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;