merge-base: do not leak commit list
Signed-off-by: Junio C Hamano <junkio@cox.net>
Junio C Hamano committed
Jan 8, 2007 at 23:10 UTC
1295228d1fdda17c2ef62e712649c962c3da5eb7
1 file changed
+4
-2
commit.c
+4
-2
@@ -1012,7 +1012,7 @@ void sort_in_topological_order_fn(struct commit_list ** list, int lifo,
1012
free(nodes);
1013
}
1014
1015
-/* merge-rebase stuff */
1015
+/* merge-base stuff */
1016
1017
/* bits #0..15 in revision.h */
1018
#define PARENT1 (1u<<16)
@@ -1020,6 +1020,8 @@ void sort_in_topological_order_fn(struct commit_list ** list, int lifo,
1020
#define STALE (1u<<18)
1021
#define RESULT (1u<<19)
1022
1023
+static const unsigned all_flags = (PARENT1 | PARENT2 | STALE | RESULT);
1024
+
1025
static struct commit *interesting(struct commit_list *list)
1026
{
1027
while (list) {
@@ -1084,6 +1086,7 @@ static struct commit_list *merge_bases(struct commit *one, struct commit *two)
1086
}
1087
1088
/* Clean up the result to remove stale ones */
1089
+ free_commit_list(list);
1090
list = result; result = NULL;
1091
while (list) {
1092
struct commit_list *n = list->next;
@@ -1099,7 +1102,6 @@ struct commit_list *get_merge_bases(struct commit *one,
1102
struct commit *two,
1103
int cleanup)
1104
{
1102
- const unsigned all_flags = (PARENT1 | PARENT2 | STALE | RESULT);
1105
struct commit_list *list;
1106
struct commit **rslt;
1107
struct commit_list *result;