From 997525c71e4ac85bb3b9a06a90d2cd0798c6626d Mon Sep 17 00:00:00 2001 From: Cameron Gutman Date: Fri, 20 Dec 2024 15:31:45 -0600 Subject: [PATCH] Fix leaks during pairing Ref: #654 --- Limelight/Crypto/CryptoManager.m | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Limelight/Crypto/CryptoManager.m b/Limelight/Crypto/CryptoManager.m index f59ce10c..f9603cc6 100644 --- a/Limelight/Crypto/CryptoManager.m +++ b/Limelight/Crypto/CryptoManager.m @@ -96,6 +96,7 @@ static NSData* p12 = nil; bio = BIO_new(BIO_s_mem()); i2d_X509_bio(bio, x509); + X509_free(x509); BUF_MEM* mem; BIO_get_mem_ptr(bio, &mem); @@ -222,6 +223,7 @@ static NSData* p12 = nil; + (NSData *)getSignatureFromCert:(NSData *)cert { BIO* bio = BIO_new_mem_buf([cert bytes], (int)[cert length]); X509* x509 = PEM_read_bio_X509(bio, NULL, NULL, NULL); + BIO_free(bio); if (!x509) { Log(LOG_E, @"Unable to parse certificate in memory!");