attr: fix leak in free_attr_elem
authorJeff King <peff@peff.net>
Thu, 12 Jan 2012 03:05:03 +0000 (22:05 -0500)
committerJunio C Hamano <gitster@pobox.com>
Thu, 12 Jan 2012 03:07:23 +0000 (19:07 -0800)
This function frees the individual "struct match_attr"s we
have allocated, but forgot to free the array holding their
pointers, leading to a minor memory leak (but it can add up
after checking attributes for paths in many directories).

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
attr.c

diff --git a/attr.c b/attr.c
index 2ce73651381c8ebfa6dfed6c2013b72059861b2b..af4083582dce5cf63e95a8c485b57b3fa982f76a 100644 (file)
--- a/attr.c
+++ b/attr.c
@@ -286,6 +286,7 @@ static void free_attr_elem(struct attr_stack *e)
                }
                free(a);
        }
+       free(e->attrs);
        free(e);
 }