diff --git a/src/matrix/e2ee/megolm/keybackup/Curve25519.ts b/src/matrix/e2ee/megolm/keybackup/Curve25519.ts index 7d2ebac7..45cacb3f 100644 --- a/src/matrix/e2ee/megolm/keybackup/Curve25519.ts +++ b/src/matrix/e2ee/megolm/keybackup/Curve25519.ts @@ -57,6 +57,7 @@ export class BackupEncryption { encryption.set_recipient_key(pubKey); } catch(err) { decryption.free(); + encryption.free(); throw err; } return new BackupEncryption(encryption, decryption);