diff options
Diffstat (limited to 'Source/charon/utils/allocator.c')
-rw-r--r-- | Source/charon/utils/allocator.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/Source/charon/utils/allocator.c b/Source/charon/utils/allocator.c index 4c65bbbf0..dcb4e4231 100644 --- a/Source/charon/utils/allocator.c +++ b/Source/charon/utils/allocator.c @@ -328,15 +328,19 @@ chunk_t allocator_alloc_as_chunk(size_t bytes) void * allocator_realloc(void * old, size_t newsize) { - return realloc(old,newsize); + void *data = realloc(old,newsize); + return data; } void * allocator_clone_bytes(void * pointer, size_t size) { + void *data; data = malloc(size); - if (data == NULL){ return NULL;} - memcpy(data,pointer,size); + + if (data == NULL){return NULL;} + memmove(data,pointer,size); + return (data); } |