From 12f1ae53243d3ff06a956da1846dde6f32498342 Mon Sep 17 00:00:00 2001 From: Miaoqian Lin Date: Mon, 19 Sep 2022 18:14:40 +0400 Subject: [PATCH] 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. Signed-off-by: Miaoqian Lin Reviewed-by: Derrick Stolee Signed-off-by: Junio C Hamano --- commit-graph.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/commit-graph.c b/commit-graph.c index 2b52818731..0d44cd0fa4 100644 --- a/commit-graph.c +++ b/commit-graph.c @@ -2269,6 +2269,8 @@ static void expire_commit_graphs(struct write_commit_graph_context *ctx) } out: + if(dir) + closedir(dir); strbuf_release(&path); }