mirror of
https://github.com/git/git.git
synced 2024-11-23 18:05:29 +08:00
attr.c: use ALLOC_GROW() in handle_attr_line()
Signed-off-by: Dmitry S. Dolzhenko <dmitrys.dolzhenko@yandex.ru> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
parent
9af49f822b
commit
3a7fa03db9
7
attr.c
7
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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user