summaryrefslogtreecommitdiff
path: root/modules/mbedtls/crypto_mbedtls.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'modules/mbedtls/crypto_mbedtls.cpp')
-rw-r--r--modules/mbedtls/crypto_mbedtls.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/modules/mbedtls/crypto_mbedtls.cpp b/modules/mbedtls/crypto_mbedtls.cpp
index 774da5a324..2522f1bb11 100644
--- a/modules/mbedtls/crypto_mbedtls.cpp
+++ b/modules/mbedtls/crypto_mbedtls.cpp
@@ -249,6 +249,13 @@ PackedByteArray HMACContextMbedTLS::finish() {
return out;
}
+HMACContextMbedTLS::~HMACContextMbedTLS() {
+ if (ctx != nullptr) {
+ mbedtls_md_free((mbedtls_md_context_t *)ctx);
+ memfree((mbedtls_md_context_t *)ctx);
+ }
+}
+
Crypto *CryptoMbedTLS::create() {
return memnew(CryptoMbedTLS);
}