{"thread":{"id":"37078","subject":"[PATCH] diff-tree: call free_commit_list() instead of duplicating its code","startedAt":"2014-07-08T16:21:05Z","lastAt":"2014-07-08T16:21:05Z","messageCount":1,"participants":["René Scharfe"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"245537","messageId":"53BC1A71.2010904@web.de","threadId":"37078","inReplyTo":null,"subject":"[PATCH] diff-tree: call free_commit_list() instead of duplicating its code","fromName":"René Scharfe","fromEmail":"l.s.r@web.de","sentAt":"2014-07-08T16:21:05Z","receivedAt":"2014-07-08T16:21:05Z","isPatch":true,"sender":{"key":"l.s.r@web.de","avatar":"https://avatars.githubusercontent.com/u/26122331?v=4"},"body":"Signed-off-by: Rene Scharfe <l.s.r@web.de>\n---\n builtin/diff-tree.c | 8 ++------\n 1 file changed, 2 insertions(+), 6 deletions(-)\n\ndiff --git a/builtin/diff-tree.c b/builtin/diff-tree.c\nindex be6417d..ce0e019 100644\n--- a/builtin/diff-tree.c\n+++ b/builtin/diff-tree.c\n@@ -22,14 +22,10 @@ static int stdin_diff_commit(struct commit *commit, char *line, int len)\n \tif (isspace(line[40]) && !get_sha1_hex(line+41, sha1)) {\n \t\t/* Graft the fake parents locally to the commit */\n \t\tint pos = 41;\n-\t\tstruct commit_list **pptr, *parents;\n+\t\tstruct commit_list **pptr;\n \n \t\t/* Free the real parent list */\n-\t\tfor (parents = commit->parents; parents; ) {\n-\t\t\tstruct commit_list *tmp = parents->next;\n-\t\t\tfree(parents);\n-\t\t\tparents = tmp;\n-\t\t}\n+\t\tfree_commit_list(commit->parents);\n \t\tcommit->parents = NULL;\n \t\tpptr = &(commit->parents);\n \t\twhile (line[pos] && !get_sha1_hex(line + pos, sha1)) {\n-- \n2.0.0\n"}]}