if (allocated_memory == NULL)
{
- return allocated_memory;
+ /* TODO LOG this case */
+ exit(-1);
}
if (use_mutex)
{
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;
}
void *data;
data = malloc(size);
- if (data == NULL){return NULL;}
+ if (data == NULL){exit(-1);}
memmove(data,pointer,size);
return (data);