aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--dir.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/dir.c b/dir.c
index b35b6330f..f6c647006 100644
--- a/dir.c
+++ b/dir.c
@@ -1329,10 +1329,7 @@ static struct path_simplify *create_simplify(const char **pathspec)
for (nr = 0 ; ; nr++) {
const char *match;
- if (nr >= alloc) {
- alloc = alloc_nr(alloc);
- simplify = xrealloc(simplify, alloc * sizeof(*simplify));
- }
+ ALLOC_GROW(simplify, nr + 1, alloc);
match = *pathspec++;
if (!match)
break;