git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] builtin-clone.c: Need to closedir() in copy_or_link_directory()
       [not found] <1211083201-2696-1-git-send-email-foo@example.com>
@ 2008-05-18  4:00 ` drafnel
  0 siblings, 0 replies; only message in thread
From: drafnel @ 2008-05-18  4:00 UTC (permalink / raw)
  To: gitster; +Cc: git, Brandon Casey

From: Brandon Casey <drafnel@gmail.com>

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

Signed-off-by: Brandon Casey <drafnel@gmail.com>
---
 builtin-clone.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/builtin-clone.c b/builtin-clone.c
index 8713128..8936a51 100644
--- a/builtin-clone.c
+++ b/builtin-clone.c
@@ -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,
-- 
1.5.5.1.447.geb0a7

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2008-05-18  3:59 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <1211083201-2696-1-git-send-email-foo@example.com>
2008-05-18  4:00 ` [PATCH] builtin-clone.c: Need to closedir() in copy_or_link_directory() drafnel

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