From 099002715d30af646d4582ac2b14322dae3f04d9 Mon Sep 17 00:00:00 2001 From: Louis Burda Date: Thu, 12 Jan 2023 15:50:56 +0100 Subject: Refactor error handling --- src/ref.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'src/ref.c') diff --git a/src/ref.c b/src/ref.c index 5c98df0..4960852 100644 --- a/src/ref.c +++ b/src/ref.c @@ -1,15 +1,13 @@ #include "ref.h" #include "util.h" -#include - struct ref * ref_alloc(void *data) { struct ref *ref; ref = malloc(sizeof(struct ref)); - if (!ref) err(1, "malloc"); + if (!ref) ERROR(SYSTEM, "malloc"); ref->link = LINK_EMPTY; ref->data = data; -- cgit v1.2.3-71-gd317