From: Dmitry S. Dolzhenko Date: Mon, 3 Mar 2014 22:31:59 +0000 (+0400) Subject: attr.c: use ALLOC_GROW() in handle_attr_line() X-Git-Tag: v2.0.0-rc0~97^2~3 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=3a7fa03db97eddec274af2ef22d96fc6f486f7c0;p=git attr.c: use ALLOC_GROW() in handle_attr_line() Signed-off-by: Dmitry S. Dolzhenko Signed-off-by: Junio C Hamano --- 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; }