aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/pluto/defs.c8
-rw-r--r--src/pluto/defs.h4
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))