{"thread":{"id":"2037","subject":"[PATCH] Reduce memory usage in git-update-server-info.","startedAt":"2005-10-06T22:49:03Z","lastAt":"2005-10-06T22:49:03Z","messageCount":1,"participants":["robfitz@273k.net"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"9781","messageId":"11286389433926-git-send-email-robfitz@273k.net","threadId":"2037","inReplyTo":null,"subject":"[PATCH] Reduce memory usage in git-update-server-info.","fromName":"","fromEmail":"robfitz@273k.net","sentAt":"2005-10-06T22:49:03Z","receivedAt":"2005-10-06T22:49:03Z","isPatch":true,"sender":{"key":"robfitz@273k.net","avatar":null},"body":"Modify parse_object_cheap() to also free all the entries from the tree\ndata structures.\n\nSigned-off-by: Robert Fitzsimons <robfitz@273k.net>\n\n---\n\n server-info.c |   10 ++++++++++\n 1 files changed, 10 insertions(+), 0 deletions(-)\n\napplies-to: fc843c89d12160dfe9704e7a0dd678cc729459cb\n67be887f195205e36c7eec39b9caea249a435e95\ndiff --git a/server-info.c b/server-info.c\n--- a/server-info.c\n+++ b/server-info.c\n@@ -59,6 +59,16 @@ static struct object *parse_object_cheap\n \t\tstruct commit *commit = (struct commit *)o;\n \t\tfree(commit->buffer);\n \t\tcommit->buffer = NULL;\n+\t} else if (o->type == tree_type) {\n+\t\tstruct tree *tree = (struct tree *)o;\n+\t\tstruct tree_entry_list *e, *n;\n+\t\tfor (e = tree->entries; e; e = n) {\n+\t\t\tfree(e->name);\n+\t\t\te->name = NULL;\n+\t\t\tn = e->next;\n+\t\t\tfree(e);\n+\t\t}\n+\t\ttree->entries = NULL;\n \t}\n \treturn o;\n }\n---\n0.99.8.GIT\n"}]}