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);
|
a = parse_attr_line(line, src, lineno, macro_ok);
|
||||||
if (!a)
|
if (!a)
|
||||||
return;
|
return;
|
||||||
if (res->alloc <= res->num_matches) {
|
ALLOC_GROW(res->attrs, res->num_matches + 1, res->alloc);
|
||||||
res->alloc = alloc_nr(res->num_matches);
|
|
||||||
res->attrs = xrealloc(res->attrs,
|
|
||||||
sizeof(struct match_attr *) *
|
|
||||||
res->alloc);
|
|
||||||
}
|
|
||||||
res->attrs[res->num_matches++] = a;
|
res->attrs[res->num_matches++] = a;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user