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:
parent
b55cbc8d9b
commit
1bd70d2eba
|
@ -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;
|
||||||
|
|
Loading…
Reference in New Issue