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 <raa.lkml@gmail.com> Acked-by: Clemens Buchacher <drizzd@aon.at> Signed-off-by: Junio C Hamano <gitster@pobox.com>
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)