OSDN Git Service
(root)
/
tomoyo
/
tomoyo-test1.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
1ba83f5
)
samples/bpf: Fix fout leak in hbm's run_bpf_prog
author
Hao Zeng
<zenghao@kylinos.cn>
Tue, 11 Apr 2023 08:43:49 +0000
(16:43 +0800)
committer
Daniel Borkmann
<daniel@iogearbox.net>
Thu, 13 Apr 2023 13:08:45 +0000
(15:08 +0200)
Fix fout being fopen'ed but then not subsequently fclose'd. In the affected
branch, fout is otherwise going out of scope.
Signed-off-by: Hao Zeng <zenghao@kylinos.cn>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Link:
https://lore.kernel.org/bpf/20230411084349.1999628-1-zenghao@kylinos.cn
samples/bpf/hbm.c
patch
|
blob
|
history
diff --git
a/samples/bpf/hbm.c
b/samples/bpf/hbm.c
index
ff58ec4
..
6448b78
100644
(file)
--- a/
samples/bpf/hbm.c
+++ b/
samples/bpf/hbm.c
@@
-315,6
+315,7
@@
static int run_bpf_prog(char *prog, int cg_id)
fout = fopen(fname, "w");
fprintf(fout, "id:%d\n", cg_id);
fprintf(fout, "ERROR: Could not lookup queue_stats\n");
+ fclose(fout);
} else if (stats_flag && qstats.lastPacketTime >
qstats.firstPacketTime) {
long long delta_us = (qstats.lastPacketTime -