summaryrefslogtreecommitdiff
path: root/commit.c
diff options
context:
space:
mode:
authorJunio C Hamano <junkio@cox.net>2007-01-08 23:10:49 -0800
committerJunio C Hamano <junkio@cox.net>2007-01-08 23:10:49 -0800
commit1295228d1fdda17c2ef62e712649c962c3da5eb7 (patch)
tree23836cef543f9fecd75188b64231d4732c172100 /commit.c
parentcdd4fb15cf06ec1de588bee4576509857d8e2cb4 (diff)
downloadgit-1295228d1fdda17c2ef62e712649c962c3da5eb7.tar.gz
merge-base: do not leak commit list
Signed-off-by: Junio C Hamano <junkio@cox.net>
Diffstat (limited to 'commit.c')
-rw-r--r--commit.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/commit.c b/commit.c
index 9ce45cec25..496d37aa02 100644
--- a/commit.c
+++ b/commit.c
@@ -1012,7 +1012,7 @@ void sort_in_topological_order_fn(struct commit_list ** list, int lifo,
free(nodes);
}
-/* merge-rebase stuff */
+/* merge-base stuff */
/* bits #0..15 in revision.h */
#define PARENT1 (1u<<16)
@@ -1020,6 +1020,8 @@ void sort_in_topological_order_fn(struct commit_list ** list, int lifo,
#define STALE (1u<<18)
#define RESULT (1u<<19)
+static const unsigned all_flags = (PARENT1 | PARENT2 | STALE | RESULT);
+
static struct commit *interesting(struct commit_list *list)
{
while (list) {
@@ -1084,6 +1086,7 @@ static struct commit_list *merge_bases(struct commit *one, struct commit *two)
}
/* Clean up the result to remove stale ones */
+ free_commit_list(list);
list = result; result = NULL;
while (list) {
struct commit_list *n = list->next;
@@ -1099,7 +1102,6 @@ struct commit_list *get_merge_bases(struct commit *one,
struct commit *two,
int cleanup)
{
- const unsigned all_flags = (PARENT1 | PARENT2 | STALE | RESULT);
struct commit_list *list;
struct commit **rslt;
struct commit_list *result;