diff options
author | Tor Andersson <tor.andersson@artifex.com> | 2013-02-19 17:19:29 +0100 |
---|---|---|
committer | Robin Watts <robin.watts@artifex.com> | 2013-02-20 13:50:38 +0000 |
commit | 4b9cebf7983cdfe9ee087ce5f2e454ce661fa204 (patch) | |
tree | 23383386cb34d7a6634846b1afa412567ffa98f5 /xps | |
parent | 8988e2f78a0eb7a5cc9743b2fac0e28a20224de9 (diff) | |
download | mupdf-4b9cebf7983cdfe9ee087ce5f2e454ce661fa204.tar.xz |
Bug 693639: plug various memory leaks.
Thanks to zeniko.
Also ensure that pdf_free_annot copes with NULL.
Diffstat (limited to 'xps')
-rw-r--r-- | xps/xps_outline.c | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/xps/xps_outline.c b/xps/xps_outline.c index 2255c51d..fc4572db 100644 --- a/xps/xps_outline.c +++ b/xps/xps_outline.c @@ -121,11 +121,20 @@ xps_load_outline(xps_document *doc) xps_fixdoc *fixdoc; fz_outline *head = NULL, *tail, *outline; - for (fixdoc = doc->first_fixdoc; fixdoc; fixdoc = fixdoc->next) { - if (fixdoc->outline) { - outline = xps_load_document_structure(doc, fixdoc); + for (fixdoc = doc->first_fixdoc; fixdoc; fixdoc = fixdoc->next) + { + if (fixdoc->outline) + { + fz_try(doc->ctx) + { + outline = xps_load_document_structure(doc, fixdoc); + } + fz_catch(doc->ctx) { + outline = NULL; + } if (!outline) continue; + if (!head) head = outline; else |