diff options
author | Sebastian Rasmussen <sebras@gmail.com> | 2017-06-28 01:37:06 +0800 |
---|---|---|
committer | Sebastian Rasmussen <sebras@gmail.com> | 2017-07-06 21:44:47 +0800 |
commit | 4ce3416885d6f4f2e7238af4d6f67d1e7746f871 (patch) | |
tree | c2b800eb8ae3e2fe872893f783c87e94b4796491 | |
parent | 4ee34af1881ebab1ad8930a14b85d479a4e533d5 (diff) | |
download | mupdf-4ce3416885d6f4f2e7238af4d6f67d1e7746f871.tar.xz |
pdf: Drop the collection schema dictionary in case of error.
-rw-r--r-- | source/pdf/pdf-portfolio.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/source/pdf/pdf-portfolio.c b/source/pdf/pdf-portfolio.c index 5c5b6d70..896aff61 100644 --- a/source/pdf/pdf-portfolio.c +++ b/source/pdf/pdf-portfolio.c @@ -288,7 +288,7 @@ void pdf_add_portfolio_schema(fz_context *ctx, pdf_document *doc, int entry, con pdf_portfolio **pp; pdf_portfolio *p; pdf_obj *s; - pdf_obj *sc; + pdf_obj *sc = NULL; int num; char str_name[32]; pdf_obj *num_name = NULL; @@ -300,6 +300,7 @@ void pdf_add_portfolio_schema(fz_context *ctx, pdf_document *doc, int entry, con load_portfolio(ctx, doc); fz_var(num_name); + fz_var(sc); pp = &doc->portfolio; while (*pp && entry > 0) @@ -350,7 +351,10 @@ void pdf_add_portfolio_schema(fz_context *ctx, pdf_document *doc, int entry, con } } fz_always(ctx) + { pdf_drop_obj(ctx, num_name); + pdf_drop_obj(ctx, sc); + } fz_catch(ctx) fz_rethrow(ctx); } |