=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/mandoc/mandoc_aux.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- src/usr.bin/mandoc/mandoc_aux.c 2014/03/21 22:52:21 1.2 +++ src/usr.bin/mandoc/mandoc_aux.c 2014/04/23 21:06:33 1.3 @@ -1,4 +1,4 @@ -/* $Id: mandoc_aux.c,v 1.2 2014/03/21 22:52:21 schwarze Exp $ */ +/* $Id: mandoc_aux.c,v 1.3 2014/04/23 21:06:33 schwarze Exp $ */ /* * Copyright (c) 2009, 2011 Kristaps Dzonsons * Copyright (c) 2014 Ingo Schwarze @@ -73,6 +73,18 @@ { ptr = realloc(ptr, size); + if (NULL == ptr) { + perror(NULL); + exit((int)MANDOCLEVEL_SYSERR); + } + return(ptr); +} + +void * +mandoc_reallocarray(void *ptr, size_t num, size_t size) +{ + + ptr = reallocarray(ptr, num, size); if (NULL == ptr) { perror(NULL); exit((int)MANDOCLEVEL_SYSERR);