From d2eafb76611670d7573f9409b0c727019fe50e18 Mon Sep 17 00:00:00 2001 From: Linus Torvalds Date: Sun, 28 May 2006 15:07:07 -0700 Subject: Add raw tree buffer info to "struct tree" This allows us to avoid allocating information for names etc, because we can just use the information from the tree buffer directly. We still keep the old "tree_entry_list" in struct tree as well, so old users aren't affected, apart from the fact that the allocations are different (if you free a tree entry, you should no longer free the name allocation for it, since it's allocated as part of "tree->buffer") Signed-off-by: Linus Torvalds Signed-off-by: Junio C Hamano --- fsck-objects.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'fsck-objects.c') diff --git a/fsck-objects.c b/fsck-objects.c index 59b25904cb..a0290b09c9 100644 --- a/fsck-objects.c +++ b/fsck-objects.c @@ -197,17 +197,16 @@ static int fsck_tree(struct tree *item) default: break; } - free(last->name); free(last); } last = entry; } - if (last) { - free(last->name); + if (last) free(last); - } item->entries = NULL; + free(item->buffer); + item->buffer = NULL; retval = 0; if (has_full_path) { -- cgit v1.2.3