summaryrefslogtreecommitdiff
path: root/pdf/pdf_xref.c
diff options
context:
space:
mode:
authorSebastian Rasmussen <sebras@gmail.com>2012-08-04 19:34:09 +0200
committerSebastian Rasmussen <sebras@gmail.com>2012-08-06 13:59:20 +0200
commit0df1f84bd59e94798a09b55aac1d7cba40be60d0 (patch)
tree2c402ccc3f9c376bfb4a37ffa8b20e7e4cfa2c50 /pdf/pdf_xref.c
parent4c00e74b4124474a736678e5554f9d8057c78de8 (diff)
downloadmupdf-0df1f84bd59e94798a09b55aac1d7cba40be60d0.tar.xz
No need to check for NULL before dropping objects
Diffstat (limited to 'pdf/pdf_xref.c')
-rw-r--r--pdf/pdf_xref.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/pdf/pdf_xref.c b/pdf/pdf_xref.c
index 6a7585bd..4d3c32b8 100644
--- a/pdf/pdf_xref.c
+++ b/pdf/pdf_xref.c
@@ -551,8 +551,7 @@ pdf_ocg_set_config(pdf_document *xref, int config)
fz_throw(xref->ctx, "Illegal OCG config");
}
- if (desc->intent)
- pdf_drop_obj(desc->intent);
+ pdf_drop_obj(desc->intent);
desc->intent = pdf_dict_gets(cobj, "Intent");
if (desc->intent)
pdf_keep_obj(desc->intent);
@@ -677,8 +676,7 @@ pdf_free_ocg(fz_context *ctx, pdf_ocg_descriptor *desc)
if (!desc)
return;
- if (desc->intent)
- pdf_drop_obj(desc->intent);
+ pdf_drop_obj(desc->intent);
fz_free(ctx, desc->ocgs);
fz_free(ctx, desc);
}
@@ -845,8 +843,7 @@ pdf_close_document(pdf_document *xref)
if (xref->file)
fz_close(xref->file);
- if (xref->trailer)
- pdf_drop_obj(xref->trailer);
+ pdf_drop_obj(xref->trailer);
if (xref->crypt)
pdf_free_crypt(ctx, xref->crypt);
@@ -1154,8 +1151,7 @@ pdf_update_object(pdf_document *xref, int num, pdf_obj *newobj)
x = &xref->table[num];
- if (x->obj)
- pdf_drop_obj(x->obj);
+ pdf_drop_obj(x->obj);
x->type = 'n';
x->ofs = 0;