@matheusbsbs / matheus-bagliano / commits / 4fe2cc0c89
Fork 0

Remove shadowing variable from traverse_trees()

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>

René Scharfe committed Jan 4, 2007 at 19:33 UTC 4fe2cc0c8906ba6d39c4fab89fe88dcf2226b184
1 file changed -1
tree-walk.c
-1
@@ -113,7 +113,6 @@ void traverse_trees(int n, struct tree_desc *t, const char *base, traverse_callb
113 struct name_entry *entry = xmalloc(n*sizeof(*entry));
114
115 for (;;) {
116 - struct name_entry entry[3];
116 unsigned long mask = 0;
117 int i, last;
118