From: Colin King <colin.king@canonical.com>
To: Alexei Starovoitov <ast@fb.com>,
"David S . Miller" <davem@davemloft.net>,
Brenden Blanco <bblanco@plumgrid.com>
Cc: linux-kernel@vger.kernel.org
Subject: [PATCH] samples/bpf: fix resource leak on opened file descriptor
Date: Sun, 24 Jul 2016 18:50:47 +0100 [thread overview]
Message-ID: <1469382647-9935-1-git-send-email-colin.king@canonical.com> (raw)
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
next reply other threads:[~2016-07-24 17:51 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-07-24 17:50 Colin King [this message]
2016-07-29 6:50 ` Alexei Starovoitov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1469382647-9935-1-git-send-email-colin.king@canonical.com \
--to=colin.king@canonical.com \
--cc=ast@fb.com \
--cc=bblanco@plumgrid.com \
--cc=davem@davemloft.net \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®