From: Dmitry S. Dolzhenko Date: Fri, 28 Feb 2014 09:47:28 GMT Subject: [PATCH v2 11/11] attr.c: change handle_attr_line() to use ALLOC_GROW() Message-ID: <53105B30.7010608@yandex.ru> In-Reply-To: <531056E7.3010305@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