From: Dmitry S. Dolzhenko Date: Mon, 03 Mar 2014 07:25:54 GMT Subject: [PATCH v3 11/11] attr.c: use ALLOC_GROW() in handle_attr_line() Message-ID: <53142E82.5080806@yandex.ru> In-Reply-To: <53142CB9.80100@yandex.ru> Signed-off-by: Dmitry S. Dolzhenko --- attr.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/attr.c b/attr.c index 8d13d70..734222d 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; } -- 1.8.5.3