diff options
author | Sebastian Rasmussen <sebras@gmail.com> | 2016-10-11 20:39:26 +0800 |
---|---|---|
committer | Sebastian Rasmussen <sebras@gmail.com> | 2016-10-18 21:25:10 +0800 |
commit | 23ac569165b66403abfe72e89007675ceaa9bde0 (patch) | |
tree | af9f03148079f3ac564bc8f6d7c007c16cf8f444 /source/pdf/pdf-xref.c | |
parent | 6dcf860ef683ab416151913150790e61ff26c1b8 (diff) | |
download | mupdf-23ac569165b66403abfe72e89007675ceaa9bde0.tar.xz |
Avoid checking argument to fz_drop_*()/fz_free().
As fz_drop_*()/fz_free() all must handle NULL.
Diffstat (limited to 'source/pdf/pdf-xref.c')
-rw-r--r-- | source/pdf/pdf-xref.c | 18 |
1 files changed, 6 insertions, 12 deletions
diff --git a/source/pdf/pdf-xref.c b/source/pdf/pdf-xref.c index a054a837..814637b9 100644 --- a/source/pdf/pdf-xref.c +++ b/source/pdf/pdf-xref.c @@ -1605,26 +1605,21 @@ pdf_drop_document_imp(fz_context *ctx, pdf_document *doc) * glyph cache at this point. */ fz_purge_glyph_cache(ctx); - if (doc->js) - pdf_drop_js(ctx, doc->js); + pdf_drop_js(ctx, doc->js); pdf_drop_xref_sections(ctx, doc); fz_free(ctx, doc->xref_index); - if (doc->focus_obj) - pdf_drop_obj(ctx, doc->focus_obj); - if (doc->file) - fz_drop_stream(ctx, doc->file); - if (doc->crypt) - pdf_drop_crypt(ctx, doc->crypt); + pdf_drop_obj(ctx, doc->focus_obj); + fz_drop_stream(ctx, doc->file); + pdf_drop_crypt(ctx, doc->crypt); pdf_drop_obj(ctx, doc->linear_obj); if (doc->linear_page_refs) { for (i=0; i < doc->page_count; i++) - { pdf_drop_obj(ctx, doc->linear_page_refs[i]); - } + fz_free(ctx, doc->linear_page_refs); } fz_free(ctx, doc->hint_page); @@ -1648,9 +1643,8 @@ pdf_drop_document_imp(fz_context *ctx, pdf_document *doc) pdf_drop_resource_tables(ctx, doc); for (i = 0; i < doc->orphans_count; i++) - { pdf_drop_obj(ctx, doc->orphans[i]); - } + fz_free(ctx, doc->orphans); } fz_always(ctx) |