Code

plug a DIR buffer leak in rerere.c
authorJim Meyering <jim@meyering.net>
Thu, 26 May 2011 13:55:50 +0000 (15:55 +0200)
committerJunio C Hamano <gitster@pobox.com>
Thu, 26 May 2011 18:20:48 +0000 (11:20 -0700)
Signed-off-by: Jim Meyering <jim@meyering.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
rerere.c

index dee2cb1514d1e97c47a4999ed66f8996035d71fe..e3407cf33417385c89aa9a1a9a9d5ad2809f57fb 100644 (file)
--- a/rerere.c
+++ b/rerere.c
@@ -739,6 +739,7 @@ void rerere_gc(struct string_list *rr)
                if (then < now - cutoff * 86400)
                        string_list_append(&to_remove, e->d_name);
        }
+       closedir(dir);
        for (i = 0; i < to_remove.nr; i++)
                unlink_rr_item(to_remove.items[i].string);
        string_list_clear(&to_remove, 0);