summaryrefslogtreecommitdiff
path: root/usr.bin/grep/util.c
diff options
context:
space:
mode:
Diffstat (limited to 'usr.bin/grep/util.c')
-rw-r--r--usr.bin/grep/util.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/usr.bin/grep/util.c b/usr.bin/grep/util.c
index 0af93493a36..970dd1413e2 100644
--- a/usr.bin/grep/util.c
+++ b/usr.bin/grep/util.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: util.c,v 1.34 2006/12/26 20:59:23 otto Exp $ */
+/* $OpenBSD: util.c,v 1.35 2007/09/02 15:19:32 deraadt Exp $ */
/*-
* Copyright (c) 1999 James Howard and Dag-Erling Coïdan Smørgrav
@@ -513,6 +513,16 @@ grep_malloc(size_t size)
}
void *
+grep_calloc(size_t nmemb, size_t size)
+{
+ void *ptr;
+
+ if ((ptr = calloc(nmemb, size)) == NULL)
+ err(2, "calloc");
+ return ptr;
+}
+
+void *
grep_realloc(void *ptr, size_t size)
{
if ((ptr = realloc(ptr, size)) == NULL)