diff options
author | tomsmeding <tom.smeding@gmail.com> | 2016-12-25 10:14:11 +0100 |
---|---|---|
committer | tomsmeding <tom.smeding@gmail.com> | 2016-12-25 10:14:11 +0100 |
commit | ef28fcb0f59d11bdf9f574a999045bc24ca40e18 (patch) | |
tree | 5e998366f3ef2f2be88216d28631656c84036e41 /memory.c |
Initial
Diffstat (limited to 'memory.c')
-rw-r--r-- | memory.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/memory.c b/memory.c new file mode 100644 index 0000000..6f8253f --- /dev/null +++ b/memory.c @@ -0,0 +1,11 @@ +#include <stdio.h> +#include "memory.h" + + +void* check_after_allocation(const char *funcname, void *ptr){ + if(ptr == NULL){ + perror(funcname); + exit(1); + } + return ptr; +} |