replaced clone_bytes() by clalloc()
This commit is contained in:
@@ -38,14 +38,6 @@ all_zero(const unsigned char *m, size_t len)
|
|||||||
return TRUE;
|
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
|
/* 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
|
* one time before unsharing the two ends of a connection. So we need
|
||||||
* at least six temporary buffers for DER_ASN1_DN IDs.
|
* at least six temporary buffers for DER_ASN1_DN IDs.
|
||||||
|
|||||||
+1
-3
@@ -42,9 +42,7 @@ typedef unsigned long so_serial_t;
|
|||||||
|
|
||||||
/* memory allocation */
|
/* memory allocation */
|
||||||
|
|
||||||
extern void *clone_bytes(const void *orig, size_t size);
|
#define clone_thing(orig) clalloc((void *)&(orig), sizeof(orig))
|
||||||
|
|
||||||
#define clone_thing(orig) clone_bytes((const void *)&(orig), sizeof(orig))
|
|
||||||
|
|
||||||
#define clone_str(str) \
|
#define clone_str(str) \
|
||||||
((str) == NULL? NULL : strdup(str))
|
((str) == NULL? NULL : strdup(str))
|
||||||
|
|||||||
Reference in New Issue
Block a user