From: Peng Hao Date: Thu, 18 Oct 2018 15:18:36 +0000 (+0800) Subject: selftests/bpf: fix file resource leak in load_kallsyms X-Git-Url: http://git.cdn.openwrt.org/?a=commitdiff_plain;h=1bd70d2eba9d90eb787634361f0f6fa2c86b3f6d;p=openwrt%2Fstaging%2Fblogic.git selftests/bpf: fix file resource leak in load_kallsyms FILE pointer variable f is opened but never closed. Signed-off-by: Peng Hao Signed-off-by: Daniel Borkmann --- 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;