diff options
author | Robin Watts <robin.watts@artifex.com> | 2011-12-15 21:25:04 +0000 |
---|---|---|
committer | Robin Watts <robin.watts@artifex.com> | 2011-12-15 21:25:04 +0000 |
commit | 7992dd366101180c050f37167d91518c52cf025c (patch) | |
tree | f85ad161cba95a6355c52c1c97b57b5380cef6d1 /fitz/stm_buffer.c | |
parent | ddbce91f5b70281f84a742845e9228ccfb607756 (diff) | |
download | mupdf-7992dd366101180c050f37167d91518c52cf025c.tar.xz |
More Memsqueezing fixes.
Diffstat (limited to 'fitz/stm_buffer.c')
-rw-r--r-- | fitz/stm_buffer.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/fitz/stm_buffer.c b/fitz/stm_buffer.c index 2722be1a..0f846987 100644 --- a/fitz/stm_buffer.c +++ b/fitz/stm_buffer.c @@ -9,7 +9,15 @@ fz_new_buffer(fz_context *ctx, int size) b = fz_malloc(ctx, sizeof(fz_buffer)); b->refs = 1; - b->data = fz_malloc(ctx, size); + fz_try(ctx) + { + b->data = fz_malloc(ctx, size); + } + fz_catch(ctx) + { + fz_free(ctx, b); + fz_rethrow(ctx); + } b->cap = size; b->len = 0; |