[PATCH] samples/bpf: fix resource leak on opened file descriptor
From: Colin King
Date: Sun Jul 24 2016 - 13:51:53 EST
From: Colin Ian King <colin.king@xxxxxxxxxxxxx>
file f needs to be closed, fixes resource leak.
Signed-off-by: Colin Ian King <colin.king@xxxxxxxxxxxxx>
---
samples/bpf/bpf_load.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/samples/bpf/bpf_load.c b/samples/bpf/bpf_load.c
index 0cfda23..5b7e71b 100644
--- a/samples/bpf/bpf_load.c
+++ b/samples/bpf/bpf_load.c
@@ -403,6 +403,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;
--
2.8.1