aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJan Hutter <jhutter@hsr.ch>2005-11-28 15:59:13 +0000
committerJan Hutter <jhutter@hsr.ch>2005-11-28 15:59:13 +0000
commitcdbfdf4e6c6edddb32099e0d046409b4578bab11 (patch)
treed79667f388dd5cdded982ad29c90f034be61bedb
parent0c7cfb183c6417569e7a0768eb58d1473033242e (diff)
downloadstrongswan-cdbfdf4e6c6edddb32099e0d046409b4578bab11.tar.bz2
strongswan-cdbfdf4e6c6edddb32099e0d046409b4578bab11.tar.xz
-rw-r--r--Source/charon/utils/allocator.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/Source/charon/utils/allocator.c b/Source/charon/utils/allocator.c
index e6b0ebabf..46194e85f 100644
--- a/Source/charon/utils/allocator.c
+++ b/Source/charon/utils/allocator.c
@@ -119,7 +119,8 @@ static void *allocate_special(private_allocator_t *this,size_t bytes, char * fil
if (allocated_memory == NULL)
{
- return allocated_memory;
+ /* TODO LOG this case */
+ exit(-1);
}
if (use_mutex)
@@ -321,7 +322,12 @@ chunk_t allocator_alloc_as_chunk(size_t bytes)
{
chunk_t new_chunk;
new_chunk.ptr = malloc(bytes);
- new_chunk.len = (new_chunk.ptr == NULL) ? 0 : bytes;
+ if ((new_chunk.ptr == NULL)
+ {
+ /* TODO log this case */
+ exit(-1);
+ }
+ new_chunk.len = bytes;
return new_chunk;
}
@@ -344,7 +350,7 @@ void * allocator_clone_bytes(void * pointer, size_t size)
void *data;
data = malloc(size);
- if (data == NULL){return NULL;}
+ if (data == NULL){exit(-1);}
memmove(data,pointer,size);
return (data);