verify_refname_available(): rename function
[gitweb.git] / remote.c
index 1101f82eaf34b936d51e0d61837c568b3691a468..10f1ffce0b00a7bef0b156678ab7c04431827f0e 100644 (file)
--- a/remote.c
+++ b/remote.c
@@ -282,6 +282,7 @@ static void read_branches_file(struct remote *remote)
                return;
 
        strbuf_getline(&buf, f, '\n');
+       fclose(f);
        strbuf_trim(&buf);
        if (!buf.len) {
                strbuf_release(&buf);
@@ -1938,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;
        }
 }