Skip to content

Commit

Permalink
merge-base: do not leak commit list
Browse files Browse the repository at this point in the history
Signed-off-by: Junio C Hamano <junkio@cox.net>
  • Loading branch information
Junio C Hamano committed Jan 9, 2007
1 parent cdd4fb1 commit 1295228
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions commit.c
Original file line number Diff line number Diff line change
Expand Up @@ -1012,14 +1012,16 @@ 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)
#define PARENT2 (1u<<17)
#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) {
Expand Down Expand Up @@ -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;
Expand All @@ -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;
Expand Down

0 comments on commit 1295228

Please sign in to comment.