diff options
author | Sebastian Rasmussen <sebras@gmail.com> | 2017-04-08 16:57:55 +0800 |
---|---|---|
committer | Sebastian Rasmussen <sebras@gmail.com> | 2017-04-14 23:07:09 +0800 |
commit | 55e44973a3e54950313a7f938b5c254184dd34d8 (patch) | |
tree | c0f3a24dd82c9ab0e794bfa1cc36581f616846ed | |
parent | b7ffcded1fdc5e762fd2b60ea3ce3b5c06c057fd (diff) | |
download | mupdf-55e44973a3e54950313a7f938b5c254184dd34d8.tar.xz |
js: Avoid duplicating cleanup code.
-rw-r--r-- | source/tools/murun.c | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/source/tools/murun.c b/source/tools/murun.c index 2ae948c5..d27d4750 100644 --- a/source/tools/murun.c +++ b/source/tools/murun.c @@ -4000,12 +4000,10 @@ static void ffi_PDFAnnotation_setQuadPoints(js_State *J) fz_try(ctx) pdf_set_annot_quad_points(ctx, annot, n, qp); - fz_catch(ctx) { + fz_always(ctx) fz_free(ctx, qp); + fz_catch(ctx) rethrow(J); - } - - fz_free(ctx, qp); } static void ffi_PDFAnnotation_getInkList(js_State *J) @@ -4089,14 +4087,12 @@ static void ffi_PDFAnnotation_setInkList(js_State *J) fz_try(ctx) pdf_set_annot_ink_list(ctx, annot, n, counts, points); - fz_catch(ctx) { + fz_always(ctx) { fz_free(ctx, counts); fz_free(ctx, points); - rethrow(J); } - - fz_free(ctx, counts); - fz_free(ctx, points); + fz_catch(ctx) + rethrow(J); } static void ffi_PDFAnnotation_updateAppearance(js_State *J) |