diff options
author | tomsmeding <tom.smeding@gmail.com> | 2017-01-18 22:16:55 +0100 |
---|---|---|
committer | tomsmeding <tom.smeding@gmail.com> | 2017-01-18 22:16:55 +0100 |
commit | 6b260962eef4caa486ceee9a60b61c67269025c6 (patch) | |
tree | dacf3dfd87d440f998eab8e486996e12132aef01 /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; +} |