From 6847e15f64a6d8c333ba92225425f7c6932a3d30 Mon Sep 17 00:00:00 2001 From: alvkeke Date: Mon, 18 Jan 2021 13:24:10 +0800 Subject: [PATCH] Fix failed in loading wasm byte-code if return NULL while size == 0 in os_malloc (#500) --- core/shared/platform/rt-thread/rtt_platform.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/core/shared/platform/rt-thread/rtt_platform.c b/core/shared/platform/rt-thread/rtt_platform.c index 508d8953..6ac8c70f 100644 --- a/core/shared/platform/rt-thread/rtt_platform.c +++ b/core/shared/platform/rt-thread/rtt_platform.c @@ -28,10 +28,6 @@ void *os_malloc(unsigned size) void *buf_fixed; rt_ubase_t *addr_field; - if (size == 0) - { - return RT_NULL; - } buf_origin = rt_malloc(size + 8 + sizeof(rt_ubase_t)); buf_fixed = buf_origin + sizeof(void*); if ((rt_ubase_t)buf_fixed & 0x7)