summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLibravatar Alex Riesen <raa.lkml@gmail.com>2009-05-24 15:16:49 +0200
committerLibravatar Junio C Hamano <gitster@pobox.com>2009-05-24 11:08:31 -0700
commit6589ebf107214a9e6db31764e847301f1adebc81 (patch)
tree2e1837dc34ceb0b15432d2821b3a3ef36b96455d
parentls-tree manpage: output of ls-tree is compatible with update-index (diff)
downloadtgif-6589ebf107214a9e6db31764e847301f1adebc81.tar.xz
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>
-rw-r--r--http-push.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/http-push.c b/http-push.c
index 6805288857..0696da0fec 100644
--- a/http-push.c
+++ b/http-push.c
@@ -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;
}
}