summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: d35bbe0)
raw | patch | inline | side by side (parent: d35bbe0)
author | Sergey Vlasov <vsu@altlinux.ru> | |
Fri, 23 Sep 2005 12:28:23 +0000 (16:28 +0400) | ||
committer | Junio C Hamano <junkio@cox.net> | |
Fri, 23 Sep 2005 21:30:45 +0000 (14:30 -0700) |
setup_indices() did not check the return value of opendir(), and
did not have a corresponding closedir() call.
Signed-off-by: Sergey Vlasov <vsu@altlinux.ru>
Signed-off-by: Junio C Hamano <junkio@cox.net>
did not have a corresponding closedir() call.
Signed-off-by: Sergey Vlasov <vsu@altlinux.ru>
Signed-off-by: Junio C Hamano <junkio@cox.net>
local-fetch.c | patch | blob | history |
diff --git a/local-fetch.c b/local-fetch.c
index 8176532320e6d11e6134d686091632d721e5e5c6..b3947a96574774c6a2aa17fa4f181a8b6c55838f 100644 (file)
--- a/local-fetch.c
+++ b/local-fetch.c
unsigned char sha1[20];
sprintf(filename, "%s/objects/pack/", path);
dir = opendir(filename);
+ if (!dir)
+ return -1;
while ((de = readdir(dir)) != NULL) {
int namelen = strlen(de->d_name);
if (namelen != 50 ||
get_sha1_hex(de->d_name + 5, sha1);
setup_index(sha1);
}
+ closedir(dir);
return 0;
}