summaryrefslogtreecommitdiff
path: root/apps
diff options
context:
space:
mode:
authorSebastian Rasmussen <sebras@gmail.com>2012-08-04 19:35:39 +0200
committerSebastian Rasmussen <sebras@gmail.com>2012-08-06 13:59:30 +0200
commitffb37aaa386095d61846419c860eb46b587b6b1d (patch)
tree313e382bf77e57062bebd26bfc5ae1dc656eb11e /apps
parentd44c98001b404a18ccc9d219976b9f32c28922c3 (diff)
downloadmupdf-ffb37aaa386095d61846419c860eb46b587b6b1d.tar.xz
Make use of fz_always instead of repeating code for error and normal path
Diffstat (limited to 'apps')
-rw-r--r--apps/mudraw.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/apps/mudraw.c b/apps/mudraw.c
index dcd7dafd..0f11a7a1 100644
--- a/apps/mudraw.c
+++ b/apps/mudraw.c
@@ -130,15 +130,17 @@ static void drawpage(fz_context *ctx, fz_document *doc, int pagenum)
dev = fz_new_list_device(ctx, list);
fz_run_page(doc, page, dev, fz_identity, &cookie);
}
- fz_catch(ctx)
+ fz_always(ctx)
{
fz_free_device(dev);
+ dev = NULL;
+ }
+ fz_catch(ctx)
+ {
fz_free_display_list(ctx, list);
fz_free_page(doc, page);
fz_throw(ctx, "cannot draw page %d in file '%s'", pagenum, filename);
}
- fz_free_device(dev);
- dev = NULL;
}
if (showxml)