diff options
-rw-r--r-- | source/pdf/pdf-js.c | 4 | ||||
-rw-r--r-- | source/tools/murun.c | 4 |
2 files changed, 2 insertions, 6 deletions
diff --git a/source/pdf/pdf-js.c b/source/pdf/pdf-js.c index f3a2ca80..aeba801c 100644 --- a/source/pdf/pdf-js.c +++ b/source/pdf/pdf-js.c @@ -589,9 +589,7 @@ static void *pdf_js_alloc(void *actx, void *ptr, int n) fz_free(ctx, ptr); return NULL; } - if (ptr) - return fz_resize_array(ctx, ptr, n, 1); - return fz_malloc_array(ctx, n, 1); + return fz_resize_array_no_throw(ctx, ptr, n, 1); } static pdf_js *pdf_new_js(fz_context *ctx, pdf_document *doc) diff --git a/source/tools/murun.c b/source/tools/murun.c index 5469483a..bff3cc61 100644 --- a/source/tools/murun.c +++ b/source/tools/murun.c @@ -20,9 +20,7 @@ static void *alloc(void *actx, void *ptr, int n) fz_free(ctx, ptr); return NULL; } - if (ptr) - return fz_resize_array(ctx, ptr, n, 1); - return fz_malloc_array(ctx, n, 1); + return fz_resize_array_no_throw(ctx, ptr, n, 1); } static int eval_print(js_State *J, const char *source) |