Skip to contentSkip to conversation

builtin-clone.c: Need to closedir() in copy_or_link_directory()

PATCH New [email protected] 1 participant 1 message Jun 15, 2016 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw

PATCH 1/1 builtin-clone.c: Need to closedir() in copy_or_link_directory()

From: Brandon Casey <[email protected]>

So not to leak file descriptors, close the directory after opening it.

---
 builtin-clone.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
builtin-clone.c +1 -0
index 8713128..8936a51 100644
@@ -215,6 +215,7 @@ static void copy_or_link_directory(char *src, char *dest)
 				die("failed to create link %s\n", dest);
 		}
 	}
+	closedir(dir);
 }
 
 static const struct ref *clone_local(const char *src_repo,
Signature · 1 line
1.5.5.1.447.geb0a7