From 9e2886aff8f330f54fb341c98dff3b61163dfc3c Mon Sep 17 00:00:00 2001 From: Sebastian Rasmussen Date: Sun, 6 Aug 2017 02:18:14 +0800 Subject: Avoid scavenging 0 bytes from store when allocating 0 bytes. --- source/fitz/memory.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'source/fitz') diff --git a/source/fitz/memory.c b/source/fitz/memory.c index d5ea7750..5aa8d78c 100644 --- a/source/fitz/memory.c +++ b/source/fitz/memory.c @@ -67,6 +67,9 @@ fz_malloc(fz_context *ctx, size_t size) void * fz_malloc_no_throw(fz_context *ctx, size_t size) { + if (size == 0) + return NULL; + return do_scavenging_malloc(ctx, size); } -- cgit v1.2.3