diff --git a/src/hb-wasm-api-buffer.hh b/src/hb-wasm-api-buffer.hh index 8feb0ee94..20e9b484c 100644 --- a/src/hb-wasm-api-buffer.hh +++ b/src/hb-wasm-api-buffer.hh @@ -130,6 +130,8 @@ HB_WASM_API (bool_t, buffer_copy_contents) (HB_WASM_EXEC_ENV return true; } + buffer_contents_free (exec_env, contentsptr); + contents->length = length; contents->info = wasm_runtime_module_dup_data (module_inst, (const char *) buffer->info, length * sizeof (buffer->info[0])); contents->pos = wasm_runtime_module_dup_data (module_inst, (const char *) buffer->pos, length * sizeof (buffer->pos[0])); diff --git a/src/hb-wasm-api-face.hh b/src/hb-wasm-api-face.hh index ece557f46..2a458f6df 100644 --- a/src/hb-wasm-api-face.hh +++ b/src/hb-wasm-api-face.hh @@ -61,6 +61,8 @@ HB_WASM_API (bool_t, face_copy_table) (HB_WASM_EXEC_ENV return true; } + blob_free (exec_env, blobptr); + blob->length = length; blob->data = wasm_runtime_module_dup_data (module_inst, hb_data, length);