Skip to content

Commit 6589ebf

Browse files
raalkmlgitster
authored andcommitted
http-push.c::remove_locks(): fix use after free
Noticed and reported by Serhat Şevki Dinçer. Signed-off-by: Alex Riesen <[email protected]> Acked-by: Clemens Buchacher <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent c98a95e commit 6589ebf

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

http-push.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1356,8 +1356,9 @@ static void remove_locks(void)
13561356

13571357
fprintf(stderr, "Removing remote locks...\n");
13581358
while (lock) {
1359+
struct remote_lock *next = lock->next;
13591360
unlock_remote(lock);
1360-
lock = lock->next;
1361+
lock = next;
13611362
}
13621363
}
13631364

0 commit comments

Comments
 (0)