From 3a7fa03db97eddec274af2ef22d96fc6f486f7c0 Mon Sep 17 00:00:00 2001 From: "Dmitry S. Dolzhenko" Date: Tue, 4 Mar 2014 02:31:59 +0400 Subject: attr.c: use ALLOC_GROW() in handle_attr_line() Signed-off-by: Dmitry S. Dolzhenko Signed-off-by: Junio C Hamano --- attr.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) (limited to 'attr.c') diff --git a/attr.c b/attr.c index 8d13d70e80..734222dc45 100644 --- a/attr.c +++ b/attr.c @@ -338,12 +338,7 @@ static void handle_attr_line(struct attr_stack *res, a = parse_attr_line(line, src, lineno, macro_ok); if (!a) return; - if (res->alloc <= res->num_matches) { - res->alloc = alloc_nr(res->num_matches); - res->attrs = xrealloc(res->attrs, - sizeof(struct match_attr *) * - res->alloc); - } + ALLOC_GROW(res->attrs, res->num_matches + 1, res->alloc); res->attrs[res->num_matches++] = a; } -- cgit v1.2.1