diff options
author | Carl Worth <cworth@cworth.org> | 2010-05-25 14:40:47 -0700 |
---|---|---|
committer | Carl Worth <cworth@cworth.org> | 2010-05-25 14:40:47 -0700 |
commit | 9bb796f33ac67abdf6c0bf55a06b0d8448caa3d3 (patch) | |
tree | befa02f5970009d94154a652d8ca7c5e96e5b017 /xtalloc.c | |
parent | 3ff81670848abb29b92e78f45080ad36cc85001c (diff) |
Add xtalloc_reference.
Yet another talloc wrapper that should come in handy.
Diffstat (limited to 'xtalloc.c')
-rw-r--r-- | xtalloc.c | 15 |
1 files changed, 15 insertions, 0 deletions
@@ -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; +} |