Fixed memory leaks
authorSansar Choinyambuu <schoinya@hsr.ch>
Wed, 28 Sep 2011 13:14:02 +0000 (15:14 +0200)
committerAndreas Steffen <andreas.steffen@strongswan.org>
Mon, 28 Nov 2011 16:19:40 +0000 (17:19 +0100)
src/libimcv/plugins/imc_attestation/imc_attestation.c
src/libimcv/plugins/imv_attestation/imv_attestation.c
src/libpts/pts/pts.c

index 101f592..4d7d800 100644 (file)
@@ -71,7 +71,7 @@ static pts_dh_group_t supported_dh_groups = 0;
  * High Entropy Random Data
  * used in calculation of shared secret for the assessment session
  */
-static chunk_t responder_nonce;
+static char *responder_nonce = NULL;
 
 /**
  * see section 3.7.1 of TCG TNC IF-IMC Specification 1.2
@@ -81,6 +81,8 @@ TNC_Result TNC_IMC_Initialize(TNC_IMCID imc_id,
                                                          TNC_Version max_version,
                                                          TNC_Version *actual_version)
 {
+       rng_t *rng;
+       
        if (imc_attestation)
        {
                DBG1(DBG_IMC, "IMC \"%s\" has already been initialized", imc_name);
index 9f9131b..af3c337 100644 (file)
@@ -66,7 +66,7 @@ static pts_dh_group_t supported_dh_groups = 0;
  * High Entropy Random Data
  * used in calculation of shared secret for the assessment session
  */
-static chunk_t initiator_nonce;
+static char *initiator_nonce = NULL;
 
 /**
  * PTS file measurement database
@@ -97,6 +97,7 @@ TNC_Result TNC_IMV_Initialize(TNC_IMVID imv_id,
                                                          TNC_Version *actual_version)
 {
        char *hash_alg, *dh_group, *uri, *cadir;
+       rng_t *rng;
 
        if (imv_attestation)
        {
@@ -485,7 +486,7 @@ TNC_Result TNC_IMV_Terminate(TNC_IMVID imv_id)
        }
        DESTROY_IF(pts_db);
        DESTROY_IF(pts_credmgr);
-       free(initiator_nonce.ptr);
+       free(initiator_nonce);
 
        libpts_deinit();
 
index b83cf34..0f850f2 100644 (file)
@@ -474,7 +474,7 @@ METHOD(pts_t, is_path_valid, bool,
        private_pts_t *this, char *path, pts_error_code_t *error_code)
 {
        struct stat st;
-       
+
        *error_code = 0;
 
        if (!stat(path, &st))