aboutsummaryrefslogtreecommitdiff
path: root/memory.c
diff options
context:
space:
mode:
Diffstat (limited to 'memory.c')
-rw-r--r--memory.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/memory.c b/memory.c
index 952bedf..aec3da2 100644
--- a/memory.c
+++ b/memory.c
@@ -7,3 +7,10 @@ void* check_after_allocation(const char *func,size_t num,size_t sz,void *ptr){
}
return ptr;
}
+
+void* check_after_allocation_str(const char *func,void *ptr){
+ if(ptr==NULL){
+ die("Allocation failed: %s()",func);
+ }
+ return ptr;
+}