diff options
author | Andreas Steffen <andreas.steffen@strongswan.org> | 2009-05-14 10:45:27 +0200 |
---|---|---|
committer | Andreas Steffen <andreas.steffen@strongswan.org> | 2009-05-14 13:55:56 +0200 |
commit | 111b96393136851d011684b3181d73650d7b6150 (patch) | |
tree | 56fa10fd9e93fc68de7717937ead93829d95b088 | |
parent | 910221c236d152f8b34de0bc20ab0dc496ae1f5d (diff) | |
download | strongswan-111b96393136851d011684b3181d73650d7b6150.tar.bz2 strongswan-111b96393136851d011684b3181d73650d7b6150.tar.xz |
replaced clone_bytes() by clalloc()
-rw-r--r-- | src/pluto/defs.c | 8 | ||||
-rw-r--r-- | src/pluto/defs.h | 4 |
2 files changed, 1 insertions, 11 deletions
diff --git a/src/pluto/defs.c b/src/pluto/defs.c index 6ade825cd..f83318e12 100644 --- a/src/pluto/defs.c +++ b/src/pluto/defs.c @@ -38,14 +38,6 @@ all_zero(const unsigned char *m, size_t len) return TRUE; } -void *clone_bytes(const void *orig, size_t size) -{ - void *p = malloc(size); - - memcpy(p, orig, size); - return p; -} - /* Note that there may be as many as six IDs that are temporary at * one time before unsharing the two ends of a connection. So we need * at least six temporary buffers for DER_ASN1_DN IDs. diff --git a/src/pluto/defs.h b/src/pluto/defs.h index c3a1a139e..8491f4ae8 100644 --- a/src/pluto/defs.h +++ b/src/pluto/defs.h @@ -42,9 +42,7 @@ typedef unsigned long so_serial_t; /* memory allocation */ -extern void *clone_bytes(const void *orig, size_t size); - -#define clone_thing(orig) clone_bytes((const void *)&(orig), sizeof(orig)) +#define clone_thing(orig) clalloc((void *)&(orig), sizeof(orig)) #define clone_str(str) \ ((str) == NULL? NULL : strdup(str)) |