1
0
Fork 0
mirror of https://github.com/git/git.git synced 2024-05-26 11:46:12 +02:00

Reduce memory usage in git-update-server-info.

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>
This commit is contained in:
robfitz@273k.net 2005-10-08 15:54:35 -07:00 committed by Junio C Hamano
parent 230f13225d
commit f22ca7c50d

View File

@ -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;
}