summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--builtin-log.c2
-rw-r--r--builtin-rev-list.c8
-rw-r--r--revision.c6
3 files changed, 14 insertions, 2 deletions
diff --git a/builtin-log.c b/builtin-log.c
index f4d974a..6afa66c 100644
--- a/builtin-log.c
+++ b/builtin-log.c
@@ -40,6 +40,8 @@ static int cmd_log_wc(int argc, const char **argv, char **envp,
log_tree_commit(rev, commit);
free(commit->buffer);
commit->buffer = NULL;
+ free_commit_list(commit->parents);
+ commit->parents = NULL;
}
return 0;
}
diff --git a/builtin-rev-list.c b/builtin-rev-list.c
index 2b298c4..71353eb 100644
--- a/builtin-rev-list.c
+++ b/builtin-rev-list.c
@@ -89,6 +89,14 @@ static void show_commit(struct commit *commit)
printf("%s%c", pretty_header, hdr_termination);
}
fflush(stdout);
+ if (commit->parents) {
+ free_commit_list(commit->parents);
+ commit->parents = NULL;
+ }
+ if (commit->buffer) {
+ free(commit->buffer);
+ commit->buffer = NULL;
+ }
}
static struct object_list **process_blob(struct blob *blob,
diff --git a/revision.c b/revision.c
index 82214eb..7bff2a1 100644
--- a/revision.c
+++ b/revision.c
@@ -949,9 +949,11 @@ struct commit *get_revision(struct rev_info *revs)
}
do {
- struct commit *commit = revs->commits->item;
+ struct commit_list *entry = revs->commits;
+ struct commit *commit = entry->item;
- revs->commits = revs->commits->next;
+ revs->commits = entry->next;
+ free(entry);
/*
* If we haven't done the list limiting, we need to look at