summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 7c4c9f4)
raw | patch | inline | side by side (parent: 7c4c9f4)
author | René Scharfe <rene.scharfe@lsrfire.ath.cx> | |
Thu, 4 Jan 2007 18:33:36 +0000 (19:33 +0100) | ||
committer | Junio C Hamano <junkio@cox.net> | |
Fri, 5 Jan 2007 06:28:46 +0000 (22:28 -0800) |
The variable named entry is allocated using malloc() and then
forgotten, it being shadowed by an automatic variable of the
same name. Fixing the array size at 3 worked so far because
the only caller of traverse_trees() needed only as much
entries. Simply remove the shadowing varaible and we're able
to traverse more than three trees and save stack space at the
same time!
Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <junkio@cox.net>
forgotten, it being shadowed by an automatic variable of the
same name. Fixing the array size at 3 worked so far because
the only caller of traverse_trees() needed only as much
entries. Simply remove the shadowing varaible and we're able
to traverse more than three trees and save stack space at the
same time!
Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <junkio@cox.net>
tree-walk.c | patch | blob | history |
diff --git a/tree-walk.c b/tree-walk.c
index 14cc5aea6c4eefbf4b0fa9c72ccb70ec550b44b4..22f4550b6ca4d2cb185fc19f6be414a8a0874a60 100644 (file)
--- a/tree-walk.c
+++ b/tree-walk.c
@@ -113,7 +113,6 @@ void traverse_trees(int n, struct tree_desc *t, const char *base, traverse_callb
struct name_entry *entry = xmalloc(n*sizeof(*entry));
for (;;) {
- struct name_entry entry[3];
unsigned long mask = 0;
int i, last;