diff options
Diffstat (limited to 'usr.bin/grep/util.c')
-rw-r--r-- | usr.bin/grep/util.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/usr.bin/grep/util.c b/usr.bin/grep/util.c index bc132f57746..c4b945d4b36 100644 --- a/usr.bin/grep/util.c +++ b/usr.bin/grep/util.c @@ -1,4 +1,4 @@ -/* $OpenBSD: util.c,v 1.48 2014/05/20 01:25:23 guenther Exp $ */ +/* $OpenBSD: util.c,v 1.49 2014/12/01 06:36:04 deraadt Exp $ */ /*- * Copyright (c) 1999 James Howard and Dag-Erling Coïdan Smørgrav @@ -568,6 +568,14 @@ grep_realloc(void *ptr, size_t size) return ptr; } +void * +grep_reallocarray(void *ptr, size_t nmemb, size_t size) +{ + if ((ptr = reallocarray(ptr, nmemb, size)) == NULL) + err(2, "reallocarray"); + return ptr; +} + #ifndef SMALL /* * Returns: i >= 0 on failure (position that it failed) |