* [PATCH] samples/bpf: fix resource leak on opened file descriptor
@ 2016-07-24 17:50 Colin King
2016-07-29 6:50 ` Alexei Starovoitov
0 siblings, 1 reply; 2+ messages in thread
From: Colin King @ 2016-07-24 17:50 UTC (permalink / raw)
To: Alexei Starovoitov, David S . Miller, Brenden Blanco; +Cc: linux-kernel
From: Colin Ian King <colin.king@canonical.com>
file f needs to be closed, fixes resource leak.
Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
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
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] samples/bpf: fix resource leak on opened file descriptor
2016-07-24 17:50 [PATCH] samples/bpf: fix resource leak on opened file descriptor Colin King
@ 2016-07-29 6:50 ` Alexei Starovoitov
0 siblings, 0 replies; 2+ messages in thread
From: Alexei Starovoitov @ 2016-07-29 6:50 UTC (permalink / raw)
To: Colin King
Cc: Alexei Starovoitov, David S . Miller, Brenden Blanco, linux-kernel
On Sun, Jul 24, 2016 at 06:50:47PM +0100, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
>
> file f needs to be closed, fixes resource leak.
>
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
have been travelling. sorry for delay.
Acked-by: Alexei Starovoitov <ast@kernel.org>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2016-07-29 6:50 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-07-24 17:50 [PATCH] samples/bpf: fix resource leak on opened file descriptor Colin King
2016-07-29 6:50 ` Alexei Starovoitov
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).