-/* $OpenBSD: options.c,v 1.84 2014/02/06 20:51:55 guenther Exp $ */
+/* $OpenBSD: options.c,v 1.85 2014/05/07 14:56:57 tedu Exp $ */
/* $NetBSD: options.c,v 1.6 1996/03/26 23:54:18 mrg Exp $ */
/*-
size_t n = nincfiles + 3;
struct incfile *p;
- p = realloc(incfiles,
- sizeof(*incfiles) * n);
+ p = reallocarray(incfiles, n,
+ sizeof(*incfiles));
if (p == NULL) {
- free(incfiles);
- incfiles = NULL;
paxwarn(0, "Unable to allocate space "
"for option list");
exit(1);
-/* $OpenBSD: tables.c,v 1.30 2014/01/08 06:43:34 deraadt Exp $ */
+/* $OpenBSD: tables.c,v 1.31 2014/05/07 14:56:57 tedu Exp $ */
/* $NetBSD: tables.c,v 1.4 1995/03/21 09:07:45 cgd Exp $ */
/*-
name = rp;
}
if (dircnt == dirsize) {
- dblk = realloc(dirp, 2 * dirsize * sizeof(DIRDATA));
+ dblk = reallocarray(dirp, dirsize, 2 * sizeof(DIRDATA));
if (dblk == NULL) {
paxwarn(1, "Unable to store mode and times for created"
" directory: %s", name);