From f1fce96a1d8026474b2cd56a855fd001cfd108b6 Mon Sep 17 00:00:00 2001 From: Craig Barnes Date: Tue, 4 Aug 2020 23:28:16 +0100 Subject: config: handle allocation failure explicitly --- xmalloc.h | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 xmalloc.h (limited to 'xmalloc.h') diff --git a/xmalloc.h b/xmalloc.h new file mode 100644 index 00000000..d4e48f79 --- /dev/null +++ b/xmalloc.h @@ -0,0 +1,10 @@ +#pragma once + +#include +#include +#include "macros.h" + +void *xmalloc(size_t size) XMALLOC; +void *xcalloc(size_t nmemb, size_t size) XMALLOC; +char *xstrdup(const char *str) XSTRDUP; +char *xasprintf(const char *format, ...) PRINTF(1) XMALLOC; -- cgit v1.3