Fix Memory Leaks (valgrind) 07/24607/3
authorGeorge Nash <george.nash@intel.com>
Sat, 7 Apr 2018 00:19:49 +0000 (17:19 -0700)
committerMats Wichmann <mats@linux.com>
Tue, 24 Apr 2018 23:59:29 +0000 (23:59 +0000)
This fixes memory leaks reported by valgrind

Change-Id: I99fe0b69e2c466e495f19bffd2226ebcd019cc85
Signed-off-by: George Nash <george.nash@intel.com>
resource/csdk/connectivity/test/cacertprofiletest.cpp

index 227b004..3b99633 100644 (file)
@@ -445,7 +445,7 @@ TEST_F(CACertProfileTests, InternalEndEntityCert)
 
     FreeTestCert(&rootCert);
     FreeTestCert(&intCert);
-    InitTestCert(&eeCert);
+    FreeTestCert(&eeCert);
 }
 
 TEST_F(CACertProfileTests, VerifyInternalCertChain)
@@ -1014,6 +1014,7 @@ static CertProfileResult GenerateTestCert(CertType certType, CertProfileViolatio
     }
 
 exit:
+    mbedtls_mpi_free(&serialMpi);
     mbedtls_pk_free(&subjectPubKeyCtx);
     mbedtls_pk_free(&issuerPrivKeyCtx);
     mbedtls_x509write_crt_free(&outCertCtx);