git-p4: add trap to kill p4d on test exit
[gitweb.git] / remote.c
index fb161530cdd5e286716d45532c1d58da26250e22..10f1ffce0b00a7bef0b156678ab7c04431827f0e 100644 (file)
--- a/remote.c
+++ b/remote.c
@@ -1939,10 +1939,8 @@ int resolve_remote_symref(struct ref *ref, struct ref *list)
 static void unmark_and_free(struct commit_list *list, unsigned int mark)
 {
        while (list) {
-               struct commit_list *temp = list;
-               temp->item->object.flags &= ~mark;
-               list = temp->next;
-               free(temp);
+               struct commit *commit = pop_commit(&list);
+               commit->object.flags &= ~mark;
        }
 }