Skip to content

armgit / ente

Public Imported from GitHub
0

πŸ’š End-to-end encrypted cloud for everything.

Free the wasm EncryptedBox after copying it in encryptBox

Manav Rathi4a6b46c894ad
diff --git a/web/packages/wasm-core/index.ts b/web/packages/wasm-core/index.ts
index 6b8f5d4008..0cdd0d3412 100644
--- a/web/packages/wasm-core/index.ts
+++ b/web/packages/wasm-core/index.ts
@@ -37,7 +37,11 @@ export const encryptBox = async (
): Promise<EncryptedBox> => {
const wasm = await loadWasmCore();
const box = wasm.encryptBox(data, key);
- return { encryptedData: box.encryptedData, nonce: box.nonce };
+ try {
+ return { encryptedData: box.encryptedData, nonce: box.nonce };
+ } finally {
+ box.free();
+ }
};
/**