Fixed freeing invalid memory issue
This commit is contained in:
committed by
Andreas Steffen
parent
849b903baa
commit
10210cc6e9
@@ -635,7 +635,8 @@ TNC_Result TNC_IMC_ReceiveMessage(TNC_IMCID imc_id,
|
|||||||
hasher = lib->crypto->create_hasher(lib->crypto, hash_alg);
|
hasher = lib->crypto->create_hasher(lib->crypto, hash_alg);
|
||||||
if (!hasher)
|
if (!hasher)
|
||||||
{
|
{
|
||||||
DBG1(DBG_IMC, " hasher %N not available", hash_algorithm_names, hash_alg);
|
DBG1(DBG_IMC, " hasher %N not available",
|
||||||
|
hash_algorithm_names, hash_alg);
|
||||||
return TNC_RESULT_FATAL;
|
return TNC_RESULT_FATAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -665,7 +666,6 @@ TNC_Result TNC_IMC_ReceiveMessage(TNC_IMCID imc_id,
|
|||||||
return TNC_RESULT_FATAL;
|
return TNC_RESULT_FATAL;
|
||||||
}
|
}
|
||||||
params.measurement_time = chunk_create(utc_time, 20);
|
params.measurement_time = chunk_create(utc_time, 20);
|
||||||
params.measurement_time = chunk_clone(params.measurement_time);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
params.measurement = chunk_create(hash_output, hasher->get_hash_size(hasher));
|
params.measurement = chunk_create(hash_output, hasher->get_hash_size(hasher));
|
||||||
@@ -687,6 +687,7 @@ TNC_Result TNC_IMC_ReceiveMessage(TNC_IMCID imc_id,
|
|||||||
/* Buffer Simple Component Evidence attribute */
|
/* Buffer Simple Component Evidence attribute */
|
||||||
attr = tcg_pts_attr_simple_comp_evid_create(params);
|
attr = tcg_pts_attr_simple_comp_evid_create(params);
|
||||||
evidences->insert_last(evidences, attr);
|
evidences->insert_last(evidences, attr);
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case PTS_FUNC_COMP_NAME_IGNORE:
|
case PTS_FUNC_COMP_NAME_IGNORE:
|
||||||
@@ -724,7 +725,7 @@ TNC_Result TNC_IMC_ReceiveMessage(TNC_IMCID imc_id,
|
|||||||
attr_list->insert_last(attr_list, attr);
|
attr_list->insert_last(attr_list, attr);
|
||||||
|
|
||||||
e->destroy(e);
|
e->destroy(e);
|
||||||
evidences->destroy(evidences);
|
DESTROY_IF(evidences);
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -564,11 +564,11 @@ pa_tnc_attr_t *tcg_pts_attr_simple_comp_evid_create(
|
|||||||
.extended_pcr = params.extended_pcr,
|
.extended_pcr = params.extended_pcr,
|
||||||
.hash_algorithm = params.hash_algorithm,
|
.hash_algorithm = params.hash_algorithm,
|
||||||
.transformation = params.transformation,
|
.transformation = params.transformation,
|
||||||
.measurement_time = params.measurement_time,
|
.measurement_time = chunk_clone(params.measurement_time),
|
||||||
.policy_uri = params.policy_uri,
|
.policy_uri = chunk_clone(params.policy_uri),
|
||||||
.pcr_before = params.pcr_before,
|
.pcr_before = chunk_clone(params.pcr_before),
|
||||||
.pcr_after = params.pcr_after,
|
.pcr_after = chunk_clone(params.pcr_after),
|
||||||
.measurement = params.measurement,
|
.measurement = chunk_clone(params.measurement),
|
||||||
);
|
);
|
||||||
|
|
||||||
return &this->public.pa_tnc_attribute;
|
return &this->public.pa_tnc_attribute;
|
||||||
|
|||||||
Reference in New Issue
Block a user