diff options
Diffstat (limited to 'image/muimage.c')
-rw-r--r-- | image/muimage.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/image/muimage.c b/image/muimage.c index 0577f1c5..6df668e2 100644 --- a/image/muimage.c +++ b/image/muimage.c @@ -33,11 +33,13 @@ image_open_document_with_stream(fz_context *ctx, fz_stream *file) { buffer = fz_read_all(doc->file, 1024); doc->image = fz_new_image_from_buffer(ctx, buffer); - buffer = NULL; } - fz_catch(ctx) + fz_always(ctx) { fz_drop_buffer(ctx, buffer); + } + fz_catch(ctx) + { image_close_document(doc); fz_rethrow(ctx); } |