diff options
author | Sebastian Rasmussen <sebras@gmail.com> | 2017-06-12 00:01:27 +0800 |
---|---|---|
committer | Sebastian Rasmussen <sebras@gmail.com> | 2017-06-16 22:06:38 +0800 |
commit | 7e87d5aef5dae4948c227cadd8a2e543b14850d5 (patch) | |
tree | d282082922240e222f3d287d032f4a2d17ceacdb /source | |
parent | 2ee8e02105ae06045203b5878bb204507c2678e3 (diff) | |
download | mupdf-7e87d5aef5dae4948c227cadd8a2e543b14850d5.tar.xz |
Plug leak of uri if creating link fails.
Diffstat (limited to 'source')
-rw-r--r-- | source/pdf/pdf-annot.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/source/pdf/pdf-annot.c b/source/pdf/pdf-annot.c index 981e7a5d..c1a463d9 100644 --- a/source/pdf/pdf-annot.c +++ b/source/pdf/pdf-annot.c @@ -273,8 +273,13 @@ pdf_load_link(fz_context *ctx, pdf_document *doc, pdf_obj *dict, int pagenum, co if (!uri) return NULL; - link = fz_new_link(ctx, &bbox, doc, uri); - fz_free(ctx, uri); + fz_try(ctx) + link = fz_new_link(ctx, &bbox, doc, uri); + fz_always(ctx) + fz_free(ctx, uri); + fz_catch(ctx) + fz_rethrow(ctx); + return link; } |