Signed-off-by: Thiago Farina <tfransosi@gmail.com> --- attr.c | 8 ++------ 1 files changed, 2 insertions(+), 6 deletions(-)
Show changes to attr.c +2 −6
diff --git a/attr.c b/attr.c index 6aff695..fdc0515 100644 --- a/attr.c +++ b/attr.c @@ -305,12 +305,8 @@ 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; }
-- 1.7.3.2.343.g7d43d