commit-graph: Fix missing closedir in expire_commit_graphs
PATCH v2 1/1 commit-graph: Fix missing closedir in expire_commit_graphs
The function calls opendir() but missing the corresponding closedir() before exit the function.
Add missing closedir() to fix it.
---
changes in v2:
- add if (dir) before closedir(), as suggested by Derrick.
--- commit-graph.c | 2 ++ 1 file changed, 2 insertions(+)
commit-graph.c +2 -0
@@ -2265,6 +2265,8 @@ static void expire_commit_graphs(struct write_commit_graph_context *ctx) } out: +if (dir) +closedir (dir);strbuf_release (&path); }
Signature · 1 line
2.25.1
Quoted 3 lines · Miaoqian Lin
The function calls
opendir()but missing the correspondingclosedir()before exit the function.
Add missingclosedir()to fix it.
Thanks for the patch, Miaoqian.
I only have a very tiny nitpick with the line breaks in your commit message. Either the "Add missing..." sentence should start immediately after the previous sentence or have another line break between the paragraphs. This shouldn't merit a re-roll, but keep it in mind for future contributions.
commit-graph.c static void expire_commit_graphs(struct write_commit_graph_context *ctx) · line 2271
Quoted 5 lines
out:
commit-graph.c +2
-0+if (dir) +closedir (dir);strbuf_release (&path); }
This change looks correct to me. Thanks!
-Stolee
Quoted 13 lines · Derrick Stolee
Quoted 3 lines · Miaoqian Lin
The function calls
opendir()but missing the correspondingclosedir()before exit the function.
Add missingclosedir()to fix it.Thanks for the patch, Miaoqian.
I only have a very tiny nitpick with the line breaks in your commit message. Either the "Add missing..." sentence should start immediately after the previous sentence or have another line break between the paragraphs. This shouldn't merit a re-roll, but keep it in mind for future contributions.
Quoted 8 lines
commit-graph.c static void expire_commit_graphs(struct write_commit_graph_context *ctx) · line 2271
Quoted 5 lines
out:
commit-graph.c +2
-0+if (dir) +closedir (dir);strbuf_release (&path); }This change looks correct to me. Thanks!
-Stolee
Thanks, both. Looking good.