fmt-merge-msg: plug small leak of commit buffer
[gitweb.git] / attr.c
diff --git a/attr.c b/attr.c
index 8d13d70e80d6d52794d53ed071b8800f9c905a05..734222dc45c588736f963dea7907258e76024415 100644 (file)
--- 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;
 }