diff --git a/dir.c b/dir.c index b35b6330f850f610b582b189d7e4d6a9ba4495db..f6c647006b0a2cad4d2f4cb56786e50950007960 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;