summaryrefslogtreecommitdiff
path: root/replace_object.c
diff options
context:
space:
mode:
Diffstat (limited to 'replace_object.c')
-rw-r--r--replace_object.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/replace_object.c b/replace_object.c
index 4ee4c8d104..0ab2dc1374 100644
--- a/replace_object.c
+++ b/replace_object.c
@@ -41,12 +41,8 @@ static int register_replace_object(struct replace_object *replace,
return 1;
}
pos = -pos - 1;
- if (replace_object_alloc <= ++replace_object_nr) {
- replace_object_alloc = alloc_nr(replace_object_alloc);
- replace_object = xrealloc(replace_object,
- sizeof(*replace_object) *
- replace_object_alloc);
- }
+ ALLOC_GROW(replace_object, replace_object_nr + 1, replace_object_alloc);
+ replace_object_nr++;
if (pos < replace_object_nr)
memmove(replace_object + pos + 1,
replace_object + pos,