mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-06 19:08:57 +09:00
selftests/bpf: fix file resource leak in load_kallsyms
[ Upstream commit 1bd70d2eba ]
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>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
56b8b18321
commit
a0ec7f6eab
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user