git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] commit-graph: Fix missing closedir in expire_commit_graphs
@ 2022-09-19 14:14 Miaoqian Lin
  2022-09-19 15:04 ` Derrick Stolee
  0 siblings, 1 reply; 3+ messages in thread
From: Miaoqian Lin @ 2022-09-19 14:14 UTC (permalink / raw)
  To: git, Junio C Hamano, Derrick Stolee, René Scharfe; +Cc: linmq006

The function calls opendir() but missing the corresponding
closedir() before exit the function.
Add missing closedir() to fix it.

Signed-off-by: Miaoqian Lin <linmq006@gmail.com>
---
changes in v2:
- add if (dir) before closedir(), as suggested by Derrick.
---
 commit-graph.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/commit-graph.c b/commit-graph.c
index 06f7d9e0b6af..a7d875593288 100644
--- a/commit-graph.c
+++ b/commit-graph.c
@@ -2265,6 +2265,8 @@ static void expire_commit_graphs(struct write_commit_graph_context *ctx)
 	}
 
 out:
+	if(dir)
+		closedir(dir);
 	strbuf_release(&path);
 }
 
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-09-19 17:41 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-09-19 14:14 [PATCH v2] commit-graph: Fix missing closedir in expire_commit_graphs Miaoqian Lin
2022-09-19 15:04 ` Derrick Stolee
2022-09-19 17:41   ` Junio C Hamano

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).