about summary refs log tree commit homepage
path: root/alloc.c
diff options
context:
space:
mode:
Diffstat (limited to 'alloc.c')
-rw-r--r--alloc.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/alloc.c b/alloc.c
index 5afcee2..f5ce8bc 100644
--- a/alloc.c
+++ b/alloc.c
@@ -58,6 +58,11 @@ _Noreturn void mog_oom(void)
         abort();
 }
 
+void mog_oom_if_null(const void *ptr)
+{
+        if (!ptr)
+                mog_oom();
+}
 
 /*
  * Cache alignment is important for sub-pagesized allocations