summaryrefslogtreecommitdiff
path: root/fsck-objects.c
diff options
context:
space:
mode:
authorLibravatar Linus Torvalds <torvalds@osdl.org>2006-05-28 15:07:07 -0700
committerLibravatar Junio C Hamano <junkio@cox.net>2006-05-28 19:40:18 -0700
commitd2eafb76611670d7573f9409b0c727019fe50e18 (patch)
tree61476cd4ade7077cfe7a8f94270cd0dede4870c1 /fsck-objects.c
parentDon't use "sscanf()" for tree mode scanning (diff)
downloadtgif-d2eafb76611670d7573f9409b0c727019fe50e18.tar.xz
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 <torvalds@osdl.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
Diffstat (limited to 'fsck-objects.c')
-rw-r--r--fsck-objects.c7
1 files changed, 3 insertions, 4 deletions
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) {