summaryrefslogtreecommitdiff
path: root/source/fitz/stream-prog.c
diff options
context:
space:
mode:
authorRobin Watts <Robin.Watts@artifex.com>2017-03-09 17:09:51 +0000
committerRobin Watts <Robin.Watts@artifex.com>2017-03-10 18:03:59 -0600
commitea00b61c7ccd14422bef33282e18fa8b4660fe74 (patch)
tree3c134043132814f0d20867be11c8d280450e5737 /source/fitz/stream-prog.c
parentb346bd28080a86acec3029aeda39e10213d431a5 (diff)
downloadmupdf-ea00b61c7ccd14422bef33282e18fa8b4660fe74.tar.xz
Fix potential double frees in error cases.
fz_new_stream cleans up the passed in state if the allocation fails, so don't free it in the caller too.
Diffstat (limited to 'source/fitz/stream-prog.c')
-rw-r--r--source/fitz/stream-prog.c10
1 files changed, 1 insertions, 9 deletions
diff --git a/source/fitz/stream-prog.c b/source/fitz/stream-prog.c
index 837c33e3..579c7c4f 100644
--- a/source/fitz/stream-prog.c
+++ b/source/fitz/stream-prog.c
@@ -122,15 +122,7 @@ fz_open_file_ptr_progressive(fz_context *ctx, FILE *file, int bps)
state->length = fz_ftell(state->file);
fz_fseek(state->file, 0, SEEK_SET);
- fz_try(ctx)
- {
- stm = fz_new_stream(ctx, state, next_prog, close_prog);
- }
- fz_catch(ctx)
- {
- fz_free(ctx, state);
- fz_rethrow(ctx);
- }
+ stm = fz_new_stream(ctx, state, next_prog, close_prog);
stm->seek = seek_prog;
stm->meta = meta_prog;