From 9bb796f33ac67abdf6c0bf55a06b0d8448caa3d3 Mon Sep 17 00:00:00 2001 From: Carl Worth Date: Tue, 25 May 2010 14:40:47 -0700 Subject: Add xtalloc_reference. Yet another talloc wrapper that should come in handy. --- xtalloc.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'xtalloc.c') diff --git a/xtalloc.c b/xtalloc.c index e52d12ac6b..656ac2d6cb 100644 --- a/xtalloc.c +++ b/xtalloc.c @@ -82,3 +82,18 @@ xtalloc_asprintf (const void *t, const char *fmt, ...) va_end(ap); return ret; } + +void * +_xtalloc_reference_loc (const void *context, + const void *ptr, const char *location) +{ + void *ret; + + ret = _talloc_reference_loc (context, ptr, location); + if (ret == NULL) { + fprintf (stderr, "Out of memory.\n"); + exit (1); + } + + return ret; +} -- cgit v1.2.3