From de257bc0be2af3b190e455ec9f1c363ac84d96d4 Mon Sep 17 00:00:00 2001 From: Jan Hutter Date: Wed, 16 Nov 2005 15:29:31 +0000 Subject: - fixed bug of generator --- Source/charon/utils/allocator.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'Source/charon/utils/allocator.c') 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); } -- cgit v1.2.3