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>
This commit is contained in:
Peng Hao 2018-10-18 23:18:36 +08:00 committed by Daniel Borkmann
parent b55cbc8d9b
commit 1bd70d2eba
1 changed files with 1 additions and 0 deletions

View File

@ -41,6 +41,7 @@ int load_kallsyms(void)
syms[i].name = strdup(func); syms[i].name = strdup(func);
i++; i++;
} }
fclose(f);
sym_cnt = i; sym_cnt = i;
qsort(syms, sym_cnt, sizeof(struct ksym), ksym_cmp); qsort(syms, sym_cnt, sizeof(struct ksym), ksym_cmp);
return 0; return 0;