From: Julian Phillips Date: Fri, 13 Nov 2009 21:25:56 +0000 (+0000) Subject: remote: fix use-after-free error detected by glibc in ref_remove_duplicates X-Git-Tag: v1.6.6-rc0~35^2 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/95c96d48e65a597cfd2bf7228ddc8c7ca30b55b7?hp=95c96d48e65a597cfd2bf7228ddc8c7ca30b55b7 remote: fix use-after-free error detected by glibc in ref_remove_duplicates In ref_remove_duplicates, when we encounter a duplicate and remove it from the list we need to make sure that the prev pointer stays pointing at the last entry and also skip over adding the just freed entry to the string_list. Previously fetch could crash with: *** glibc detected *** git: corrupted double-linked list: ... Also add a test to try and catch problems with duplicate removal in the future. Acked-by: Nicolas Pitre Signed-off-by: Julian Phillips Signed-off-by: Junio C Hamano ---