Skip to content

Commit cf261f2

Browse files
authored
[wasm2c] Fix realloc check in wasm_rt_grow_memory (#1171)
See issue #1159.
1 parent 2f63483 commit cf261f2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

wasm2c/wasm-rt-impl.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ uint32_t wasm_rt_grow_memory(wasm_rt_memory_t* memory, uint32_t delta) {
111111
}
112112
uint32_t new_size = new_pages * PAGE_SIZE;
113113
uint8_t* new_data = realloc(memory->data, new_size);
114-
if (memory->data == NULL) {
114+
if (new_data == NULL) {
115115
return (uint32_t)-1;
116116
}
117117
memory->pages = new_pages;

0 commit comments

Comments
 (0)