Fix failed in loading wasm byte-code if return NULL while size == 0 in os_malloc (#500)

This commit is contained in:
alvkeke 2021-01-18 13:24:10 +08:00 committed by GitHub
parent 240ca2ed46
commit 6847e15f64
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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)