merge-recursive: don't segfault while handling rename clashes
[gitweb.git] / http-push.c
index cb5bf95a736c571259aef51884cc20e4169bf707..f743c9796a369a44c84238c244314da3c7b45dab 100644 (file)
@@ -1356,8 +1356,9 @@ static void remove_locks(void)
 
        fprintf(stderr, "Removing remote locks...\n");
        while (lock) {
+               struct remote_lock *next = lock->next;
                unlock_remote(lock);
-               lock = lock->next;
+               lock = next;
        }
 }