diff options
author | Jan Hutter <jhutter@hsr.ch> | 2005-11-14 16:03:26 +0000 |
---|---|---|
committer | Jan Hutter <jhutter@hsr.ch> | 2005-11-14 16:03:26 +0000 |
commit | b3fd2b7207ed8ae037fc8d5bf24f948b042ef2f3 (patch) | |
tree | 5e923f7bcdc7d99969afdca410f6749c6d625b4e /Source/charon/payloads/transform_attribute.c | |
parent | f3c01a28fe461847662ed15ac4709752c93f7d66 (diff) | |
download | strongswan-b3fd2b7207ed8ae037fc8d5bf24f948b042ef2f3.tar.bz2 strongswan-b3fd2b7207ed8ae037fc8d5bf24f948b042ef2f3.tar.xz |
- compute_length written
Diffstat (limited to 'Source/charon/payloads/transform_attribute.c')
-rw-r--r-- | Source/charon/payloads/transform_attribute.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/Source/charon/payloads/transform_attribute.c b/Source/charon/payloads/transform_attribute.c index dfdd4072b..b3128e82e 100644 --- a/Source/charon/payloads/transform_attribute.c +++ b/Source/charon/payloads/transform_attribute.c @@ -150,6 +150,15 @@ static size_t get_length(private_transform_attribute_t *this) */ static status_t set_value (private_transform_attribute_t *this, chunk_t value) { + if (this->attribute_value.ptr != NULL) + { + /* free existing value */ + allocator_free(this->attribute_value.ptr); + this->attribute_value.ptr = NULL; + this->attribute_value.len = 0; + + } + if (value.len > 2) { this->attribute_value.ptr = allocator_clone_bytes(value.ptr,value.len); |