[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1469382647-9935-1-git-send-email-colin.king@canonical.com>
Date: Sun, 24 Jul 2016 18:50:47 +0100
From: Colin King <colin.king@...onical.com>
To: Alexei Starovoitov <ast@...com>,
"David S . Miller" <davem@...emloft.net>,
Brenden Blanco <bblanco@...mgrid.com>
Cc: linux-kernel@...r.kernel.org
Subject: [PATCH] samples/bpf: fix resource leak on opened file descriptor
From: Colin Ian King <colin.king@...onical.com>
file f needs to be closed, fixes resource leak.
Signed-off-by: Colin Ian King <colin.king@...onical.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
Powered by blists - more mailing lists