From c21d2afbe921fb8b12e07a2eccdf7cf7a0e2bf61 Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Thu, 22 Dec 2016 11:25:52 +0100 Subject: js: Fix allocator callbacks so they don't throw fitz exceptions. Valgrind doesn't know realloc(p, 0) is equivalent to free(p), so unfortunately we can't reduce all calls to just realloc(). --- source/tools/murun.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'source/tools/murun.c') 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) -- cgit v1.2.3