compat/basename: make basename() conform to POSIX
[gitweb.git] / remote.c
index 26504b744786c65ea4d6e1e0abbf5c6409af5358..ee6edfa33548ef4a1a6c5b66bac61423b1d0cef1 100644 (file)
--- a/remote.c
+++ b/remote.c
@@ -1975,10 +1975,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;
        }
 }