fixed two memory leaks

This commit is contained in:
Andreas Steffen
2011-11-28 21:22:01 +01:00
parent 893bf977c5
commit 56fd3baa34
4 changed files with 6 additions and 5 deletions
@@ -105,8 +105,8 @@ METHOD(pts_component_t, measure, status_t,
pcr_after = chunk_from_hex(
chunk_create(pcr_after_hex, strlen(pcr_after_hex)), NULL);
evid = *evidence = pts_comp_evidence_create(this->name, 0,
this->extended_pcr,
evid = *evidence = pts_comp_evidence_create(this->name->clone(this->name),
0, this->extended_pcr,
PTS_MEAS_ALGO_SHA1, PTS_PCR_TRANSFORM_NO,
this->measurement_time, measurement);
evid->set_pcr_info(evid, pcr_before, pcr_after);
@@ -77,7 +77,8 @@ METHOD(pts_component_t, measure, status_t,
pcr_before = chunk_alloc(PCR_LEN);
memset(pcr_before.ptr, 0x00, pcr_before.len);
evid = *evidence = pts_comp_evidence_create(this->name, 0, extended_pcr,
evid = *evidence = pts_comp_evidence_create(this->name->clone(this->name),
0, extended_pcr,
PTS_MEAS_ALGO_SHA1, PTS_PCR_TRANSFORM_NO,
measurement_time, measurement);
evid->set_pcr_info(evid, pcr_before, pcr_after);
@@ -208,7 +208,7 @@ pts_comp_evidence_t *pts_comp_evidence_create(pts_comp_func_name_t *name,
.set_validation = _set_validation,
.destroy = _destroy,
},
.name = name->clone(name),
.name = name,
.depth = depth,
.extended_pcr = extended_pcr,
.hash_algorithm = algo,