fixed two memory leaks
authorAndreas Steffen <andreas.steffen@strongswan.org>
Mon, 21 Nov 2011 22:32:39 +0000 (23:32 +0100)
committerAndreas Steffen <andreas.steffen@strongswan.org>
Mon, 28 Nov 2011 20:22:01 +0000 (21:22 +0100)
src/libpts/pts/components/ita/ita_comp_tboot.c
src/libpts/pts/components/ita/ita_comp_tgrub.c
src/libpts/pts/components/pts_comp_evidence.c
src/libpts/tcg/tcg_pts_attr_req_func_comp_evid.c

index 7d1e67a..dc47e4b 100644 (file)
@@ -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);
index aae3bf4..9a4da6d 100644 (file)
@@ -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);
index f6f40da..a1e5902 100644 (file)
@@ -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,
index 58f8a0c..0629895 100644 (file)
@@ -278,7 +278,7 @@ METHOD(tcg_pts_attr_req_func_comp_evid_t, add_component, void,
        entry = malloc_thing(entry_t);
        entry->flags = flags;
        entry->depth = depth;
-       entry->name = name->clone(name);
+       entry->name = name;
        this->list->insert_last(this->list, entry);
 }