summaryrefslogtreecommitdiff
path: root/gfx/pdftoc.c
diff options
context:
space:
mode:
Diffstat (limited to 'gfx/pdftoc.c')
-rw-r--r--gfx/pdftoc.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/gfx/pdftoc.c b/gfx/pdftoc.c
index 5324823..cf45859 100644
--- a/gfx/pdftoc.c
+++ b/gfx/pdftoc.c
@@ -114,8 +114,7 @@ static void add_object(struct pdftoc *ctx, int id, int gen, unsigned pos)
struct object *obj;
if (id > ctx->top) {
- ctx->objs = realloc(ctx->objs,
- (id + 1) * sizeof(struct object));
+ ctx->objs = realloc_type_n(ctx->objs, struct object, id + 1);
memset(ctx->objs + ctx->top + 1 , 0,
(id - ctx->top) * sizeof(struct object));
ctx->top = id;