diff options
author | Martin Willi <martin@strongswan.org> | 2007-04-16 08:37:52 +0000 |
---|---|---|
committer | Martin Willi <martin@strongswan.org> | 2007-04-16 08:37:52 +0000 |
commit | 418dbd624363d9712c0d883084962cf93ae01b2a (patch) | |
tree | a8b5f9c930525c4679683e77e0cb59088e297f19 | |
parent | dd3b7b71478422cf78209d9c64e2ecdaf92154fe (diff) | |
download | strongswan-418dbd624363d9712c0d883084962cf93ae01b2a.tar.bz2 strongswan-418dbd624363d9712c0d883084962cf93ae01b2a.tar.xz |
cloning %any ID without zero-byte memleak
-rw-r--r-- | src/libstrongswan/utils/identification.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/libstrongswan/utils/identification.c b/src/libstrongswan/utils/identification.c index 8c2f4f3c8..673cbb828 100644 --- a/src/libstrongswan/utils/identification.c +++ b/src/libstrongswan/utils/identification.c @@ -963,7 +963,10 @@ static identification_t *clone_(private_identification_t *this) private_identification_t *clone = identification_create(); clone->type = this->type; - clone->encoded = chunk_clone(this->encoded); + if (this->encoded.len) + { + clone->encoded = chunk_clone(this->encoded); + } clone->public.equals = this->public.equals; clone->public.matches = this->public.matches; |