summaryrefslogtreecommitdiffstats
path: root/src/ref.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/ref.c')
-rw-r--r--src/ref.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/ref.c b/src/ref.c
index aec1c39..5c98df0 100644
--- a/src/ref.c
+++ b/src/ref.c
@@ -1,13 +1,15 @@
#include "ref.h"
#include "util.h"
+#include <err.h>
+
struct ref *
ref_alloc(void *data)
{
struct ref *ref;
ref = malloc(sizeof(struct ref));
- if (!ref) return NULL;
+ if (!ref) err(1, "malloc");
ref->link = LINK_EMPTY;
ref->data = data;