From ffb37aaa386095d61846419c860eb46b587b6b1d Mon Sep 17 00:00:00 2001 From: Sebastian Rasmussen Date: Sat, 4 Aug 2012 19:35:39 +0200 Subject: Make use of fz_always instead of repeating code for error and normal path --- xps/xps_zip.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'xps/xps_zip.c') diff --git a/xps/xps_zip.c b/xps/xps_zip.c index 17523f10..e7756f89 100644 --- a/xps/xps_zip.c +++ b/xps/xps_zip.c @@ -626,12 +626,14 @@ xps_open_document(fz_context *ctx, char *filename) { doc = xps_open_document_with_stream(file); } - fz_catch(ctx) + fz_always(ctx) { fz_close(file); + } + fz_catch(ctx) + { fz_throw(ctx, "cannot load document '%s'", filename); } - fz_close(file); return doc; } -- cgit v1.2.3