Subject: [PATCH v3 11/11] attr.c: use ALLOC_GROW() in handle_attr_line()

From: "Dmitry S. Dolzhenko" <[email-masked]>
Date: Mon, 03 Mar 2014 11:25:54 +0400

Signed-off-by: Dmitry S. Dolzhenko <[email-masked]>
---
 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