Skip to content

Commit

Permalink
attr.c: use ALLOC_GROW() in handle_attr_line()
Browse files Browse the repository at this point in the history
Signed-off-by: Dmitry S. Dolzhenko <dmitrys.dolzhenko@yandex.ru>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
Dmitry S. Dolzhenko authored and Junio C Hamano committed Mar 3, 2014
1 parent 9af49f8 commit 3a7fa03
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions attr.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit 3a7fa03

Please sign in to comment.