aboutsummaryrefslogtreecommitdiffstats
path: root/Source/charon/utils/allocator.c
diff options
context:
space:
mode:
authorJan Hutter <jhutter@hsr.ch>2005-11-16 15:29:31 +0000
committerJan Hutter <jhutter@hsr.ch>2005-11-16 15:29:31 +0000
commitde257bc0be2af3b190e455ec9f1c363ac84d96d4 (patch)
treeb3c725b24b617ada1f0244423b158eb43f8651d7 /Source/charon/utils/allocator.c
parentd5fc0f731d2eb6dcc11e680b2e77890b7ba01725 (diff)
downloadstrongswan-de257bc0be2af3b190e455ec9f1c363ac84d96d4.tar.bz2
strongswan-de257bc0be2af3b190e455ec9f1c363ac84d96d4.tar.xz
- fixed bug of generator
Diffstat (limited to 'Source/charon/utils/allocator.c')
-rw-r--r--Source/charon/utils/allocator.c10
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);
}