summaryrefslogtreecommitdiff
path: root/common/compat.c
diff options
context:
space:
mode:
Diffstat (limited to 'common/compat.c')
-rw-r--r--common/compat.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/common/compat.c b/common/compat.c
index eda00d0..1d94f1e 100644
--- a/common/compat.c
+++ b/common/compat.c
@@ -235,6 +235,18 @@ atexitv(voidfunc func, void* data)
#endif /* HAVE_ATEXITV */
+#ifndef HAVE_XREALLOC
+
+void*
+xrealloc(void *p, size_t size)
+{
+ register void* value = realloc(p, size);
+ if(value == NULL && size)
+ errx(1, "out of memory");
+ return value;
+}
+
+#endif /* HAVE_XREALLOC */
#ifndef HAVE_XCALLOC