From: robfitz@273k.net Date: Sat, 8 Oct 2005 22:54:35 +0000 (-0700) Subject: Reduce memory usage in git-update-server-info. X-Git-Tag: v0.99.9~177 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=f22ca7c50d79fcfd769ddcda988e0981fb883a16;p=git.git 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 Signed-off-by: Junio C Hamano --- diff --git a/server-info.c b/server-info.c index a9e5607f2..3c08a288d 100644 --- 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; }