diff --git a/usr.sbin/rwhod/rwhod.c b/usr.sbin/rwhod/rwhod.c index 4dbd03958cd..96fd9ec42e5 100644 --- a/usr.sbin/rwhod/rwhod.c +++ b/usr.sbin/rwhod/rwhod.c @@ -410,11 +410,8 @@ onalrm(signo) utmptime = stb.st_mtime; if (stb.st_size > utmpsize) { utmpsize = stb.st_size + 10 * sizeof(struct utmp); - if (utmp) - utmp = (struct utmp *)realloc(utmp, utmpsize); - else - utmp = (struct utmp *)malloc(utmpsize); - if (! utmp) { + utmp = (struct utmp *)reallocf(utmp, utmpsize); + if (utmp == NULL) { syslog(LOG_WARNING, "malloc failed"); utmpsize = 0; goto done;