aboutsummaryrefslogtreecommitdiff
path: root/networking
diff options
context:
space:
mode:
Diffstat (limited to 'networking')
-rw-r--r--networking/ifupdown.c6
1 files changed, 1 insertions, 5 deletions
diff --git a/networking/ifupdown.c b/networking/ifupdown.c
index 2b5e8a14e..cb937cac4 100644
--- a/networking/ifupdown.c
+++ b/networking/ifupdown.c
@@ -721,11 +721,7 @@ static struct interfaces_file_t *read_interfaces(const char *filename)
currmap = xzalloc(sizeof(*currmap));
while ((first_word = next_word(&rest_of_line)) != NULL) {
- if (currmap->n_matches >= currmap->max_matches) {
- currmap->max_matches = currmap->max_matches * 2 + 1;
- currmap->match = xrealloc(currmap->match,
- sizeof(*currmap->match) * currmap->max_matches);
- }
+ currmap->match = xrealloc_vector(currmap->match, 4, currmap->n_matches);
currmap->match[currmap->n_matches++] = xstrdup(first_word);
}
/*currmap->max_mappings = 0; - done by xzalloc */