summary refs log tree commit diff
path: root/xmalloc.c
diff options
context:
space:
mode:
authorokan <okan>2015-03-29 00:21:05 +0000
committerokan <okan>2015-03-29 00:21:05 +0000
commitbc21e4aa37b36b486f7f6ddcb6050e2be93590c1 (patch)
treeda1b2c2fff822dbb33ab2c7b2692cb7599796d03 /xmalloc.c
parent668da8493abd2abb6242a0a707e4d745c01b1031 (diff)
parent557cd382dcd973fd96605c3359e3d6dfa45a4fd9 (diff)
downloadcwm-bc21e4aa37b36b486f7f6ddcb6050e2be93590c1.tar.gz
cwm-bc21e4aa37b36b486f7f6ddcb6050e2be93590c1.tar.xz
cwm-bc21e4aa37b36b486f7f6ddcb6050e2be93590c1.zip
cvsimport
Diffstat (limited to 'xmalloc.c')
-rw-r--r--xmalloc.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/xmalloc.c b/xmalloc.c
index 059d7b3..ccfaa67 100644
--- a/xmalloc.c
+++ b/xmalloc.c
@@ -61,6 +61,18 @@ xcalloc(size_t no, size_t siz)
 	return(p);
 }
 
+void *
+xreallocarray(void *ptr, size_t nmemb, size_t size)
+{
+	void	*p;
+
+	p = reallocarray(ptr, nmemb, size);
+	if (p == NULL)
+		errx(1, "xreallocarray: out of memory (new_size %zu bytes)",
+		    nmemb * size);
+	return(p);
+}
+
 char *
 xstrdup(const char *str)
 {