Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Peng Hao and committed by
Daniel Borkmann
1bd70d2e b55cbc8d

+1
+1
tools/testing/selftests/bpf/trace_helpers.c
··· 41 41 syms[i].name = strdup(func); 42 42 i++; 43 43 } 44 + fclose(f); 44 45 sym_cnt = i; 45 46 qsort(syms, sym_cnt, sizeof(struct ksym), ksym_cmp); 46 47 return 0;