Commit 1bd70d2e authored by Peng Hao's avatar Peng Hao Committed by Daniel Borkmann

selftests/bpf: fix file resource leak in load_kallsyms

FILE pointer variable f is opened but never closed.
Signed-off-by: default avatarPeng Hao <peng.hao2@zte.com.cn>
Signed-off-by: default avatarDaniel Borkmann <daniel@iogearbox.net>
parent b55cbc8d
...@@ -41,6 +41,7 @@ int load_kallsyms(void) ...@@ -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;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment