Andrew's git
/
gitweb.git
/ diff
summary
|
log
|
commit
| diff |
tree
commit
grep
author
committer
pickaxe
?
re
Reduce memory usage in git-update-server-info.
author
robfitz@273k.net
<robfitz@273k.net>
Sat, 8 Oct 2005 22:54:35 +0000
(15:54 -0700)
committer
Junio C Hamano
<junkio@cox.net>
Sat, 8 Oct 2005 22:54:35 +0000
(15:54 -0700)
Modify parse_object_cheap() to also free all the entries from the tree
data structures.
Signed-off-by: Robert Fitzsimons <robfitz@273k.net>
Signed-off-by: Junio C Hamano <junkio@cox.net>
server-info.c
patch
|
blob
|
history
raw
|
patch
| inline |
side by side
(parent:
230f132
)
diff --git
a/server-info.c
b/server-info.c
index a9e5607f2f5668411e5742243372bf570c2bda72..3c08a288db9fd36b637b8da854a63cfbdcaa03da 100644
(file)
--- a/
server-info.c
+++ b/
server-info.c
@@
-59,6
+59,16
@@
static struct object *parse_object_cheap(const unsigned char *sha1)
struct commit *commit = (struct commit *)o;
free(commit->buffer);
commit->buffer = NULL;
+ } else if (o->type == tree_type) {
+ struct tree *tree = (struct tree *)o;
+ struct tree_entry_list *e, *n;
+ for (e = tree->entries; e; e = n) {
+ free(e->name);
+ e->name = NULL;
+ n = e->next;
+ free(e);
+ }
+ tree->entries = NULL;
}
return o;
}