Skip to content

Commit e89bec4

Browse files
committed
use pkEncryption, to properly close it.
1 parent f7195a8 commit e89bec4

File tree

1 file changed

+3
-1
lines changed
  • matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/contentscanner

1 file changed

+3
-1
lines changed

matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/contentscanner/ScanEncryptorUtils.kt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,9 @@ internal object ScanEncryptorUtils {
4646
return if (publicServerKey != null) {
4747
// Note: fromBase64 can throw Exception
4848
val pkEncryption = PkEncryption.fromBase64(key = publicServerKey)
49-
val pkMessage = pkEncryption.encrypt(DownloadBody(encryptedInfo).toCanonicalJson())
49+
val pkMessage = pkEncryption.use {
50+
pkEncryption.encrypt(DownloadBody(encryptedInfo).toCanonicalJson())
51+
}
5052
DownloadBody(
5153
encryptedBody = EncryptedBody(
5254
cipherText = pkMessage.ciphertext,

0 commit comments

Comments
 (0)