From 5113680f95e522c677cdd37072cfffbdca06831e Mon Sep 17 00:00:00 2001 From: Martin Willi Date: Mon, 10 Apr 2006 08:07:38 +0000 Subject: - split up in libstrong, charon, stroke, testing done - new leak detective with malloc hook in library - useable, but needs improvements - logger_manager has now a single instance per library - allows use of loggers from any linking prog - a LOT of other things --- Source/charon/encoding/payloads/transform_attribute.c | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) (limited to 'Source/charon/encoding/payloads/transform_attribute.c') diff --git a/Source/charon/encoding/payloads/transform_attribute.c b/Source/charon/encoding/payloads/transform_attribute.c index 9f9d82924..71cdd59e2 100644 --- a/Source/charon/encoding/payloads/transform_attribute.c +++ b/Source/charon/encoding/payloads/transform_attribute.c @@ -19,15 +19,14 @@ * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * for more details. */ - -/* offsetof macro */ + +#include #include #include "transform_attribute.h" #include #include -#include typedef struct private_transform_attribute_t private_transform_attribute_t; @@ -170,7 +169,7 @@ static void set_value_chunk(private_transform_attribute_t *this, chunk_t value) if (this->attribute_value.ptr != NULL) { /* free existing value */ - allocator_free(this->attribute_value.ptr); + free(this->attribute_value.ptr); this->attribute_value.ptr = NULL; this->attribute_value.len = 0; @@ -178,7 +177,7 @@ static void set_value_chunk(private_transform_attribute_t *this, chunk_t value) if (value.len > 2) { - this->attribute_value.ptr = allocator_clone_bytes(value.ptr,value.len); + this->attribute_value.ptr = clalloc(value.ptr,value.len); this->attribute_value.len = value.len; this->attribute_length_or_value = value.len; /* attribute has not a fixed length */ @@ -198,7 +197,7 @@ static void set_value(private_transform_attribute_t *this, u_int16_t value) if (this->attribute_value.ptr != NULL) { /* free existing value */ - allocator_free(this->attribute_value.ptr); + free(this->attribute_value.ptr); this->attribute_value.ptr = NULL; this->attribute_value.len = 0; @@ -267,7 +266,7 @@ static transform_attribute_t * clone(private_transform_attribute_t *this) if (!new_clone->attribute_format) { - new_clone->attribute_value.ptr = allocator_clone_bytes(this->attribute_value.ptr,this->attribute_value.len); + new_clone->attribute_value.ptr = clalloc(this->attribute_value.ptr,this->attribute_value.len); new_clone->attribute_value.len = this->attribute_value.len; } @@ -281,9 +280,9 @@ static void destroy(private_transform_attribute_t *this) { if (this->attribute_value.ptr != NULL) { - allocator_free(this->attribute_value.ptr); + free(this->attribute_value.ptr); } - allocator_free(this); + free(this); } /* @@ -291,7 +290,7 @@ static void destroy(private_transform_attribute_t *this) */ transform_attribute_t *transform_attribute_create() { - private_transform_attribute_t *this = allocator_alloc_thing(private_transform_attribute_t); + private_transform_attribute_t *this = malloc_thing(private_transform_attribute_t); /* payload interface */ this->public.payload_interface.verify = (status_t (*) (payload_t *))verify; -- cgit v1.2.3