[bpf-next] selftests/bpf: fix file resource leak
diff mbox series

Message ID 1539875916-28560-1-git-send-email-peng.hao2@zte.com.cn
State New
Headers show
Series
  • [bpf-next] selftests/bpf: fix file resource leak
Related show

Commit Message

Peng Hao Oct. 18, 2018, 3:18 p.m. UTC
FILE pointer variable f is opened but never closed.

Signed-off-by:Peng Hao <peng.hao2@zte.com.cn>
---
 tools/testing/selftests/bpf/trace_helpers.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Daniel Borkmann Oct. 18, 2018, 8:14 p.m. UTC | #1
On 10/18/2018 05:18 PM, Peng Hao wrote:
> FILE pointer variable f is opened but never closed.
> 
> Signed-off-by:Peng Hao <peng.hao2@zte.com.cn>

Applied to bpf-next, thanks Peng!

Patch
diff mbox series

diff --git a/tools/testing/selftests/bpf/trace_helpers.c b/tools/testing/selftests/bpf/trace_helpers.c
index cabe2a3..a3d1dac 100644
--- a/tools/testing/selftests/bpf/trace_helpers.c
+++ b/tools/testing/selftests/bpf/trace_helpers.c
@@ -41,6 +41,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;