summaryrefslogtreecommitdiff
path: root/source
diff options
context:
space:
mode:
Diffstat (limited to 'source')
-rw-r--r--source/pdf/pdf-xobject.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/source/pdf/pdf-xobject.c b/source/pdf/pdf-xobject.c
index 4fcea897..9904570d 100644
--- a/source/pdf/pdf-xobject.c
+++ b/source/pdf/pdf-xobject.c
@@ -154,22 +154,20 @@ pdf_new_xobject(fz_context *ctx, pdf_document *doc, const fz_rect *bbox, const f
idict_num = pdf_create_object(ctx, doc);
pdf_update_object(ctx, doc, idict_num, dict);
idict = pdf_new_indirect(ctx, doc, idict_num, 0);
- pdf_drop_obj(ctx, dict);
- dict = NULL;
pdf_store_item(ctx, idict, form, pdf_xobject_size(form));
form->obj = pdf_keep_obj(ctx, idict);
-
+ }
+ fz_always(ctx)
+ {
+ pdf_drop_obj(ctx, dict);
+ pdf_drop_obj(ctx, res);
pdf_drop_xobject(ctx, form);
- form = NULL;
}
fz_catch(ctx)
{
- pdf_drop_obj(ctx, res);
- pdf_drop_obj(ctx, dict);
pdf_drop_obj(ctx, idict);
- pdf_drop_xobject(ctx, form);
fz_rethrow(ctx);
}