From owner-svn-src-all@FreeBSD.ORG Sun Apr 11 12:07:04 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 57D85106566C; Sun, 11 Apr 2010 12:07:04 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 45F518FC0A; Sun, 11 Apr 2010 12:07:04 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o3BC74Cm092149; Sun, 11 Apr 2010 12:07:04 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3BC74Lf092147; Sun, 11 Apr 2010 12:07:04 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201004111207.o3BC74Lf092147@svn.freebsd.org> From: Ed Schouten Date: Sun, 11 Apr 2010 12:07:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r206472 - head/usr.sbin/lastlogin X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 Apr 2010 12:07:04 -0000 Author: ed Date: Sun Apr 11 12:07:03 2010 New Revision: 206472 URL: http://svn.freebsd.org/changeset/base/206472 Log: Don't forget to catch realloc() errors. Modified: head/usr.sbin/lastlogin/lastlogin.c Modified: head/usr.sbin/lastlogin/lastlogin.c ============================================================================== --- head/usr.sbin/lastlogin/lastlogin.c Sun Apr 11 12:02:13 2010 (r206471) +++ head/usr.sbin/lastlogin/lastlogin.c Sun Apr 11 12:07:03 2010 (r206472) @@ -88,9 +88,12 @@ main(int argc, char *argv[]) while ((u = getutxent()) != NULL) { if (u->ut_type != USER_PROCESS) continue; - if ((ulistsize % 16) == 0) + if ((ulistsize % 16) == 0) { ulist = realloc(ulist, (ulistsize + 16) * sizeof(struct utmpx)); + if (ulist == NULL) + err(1, "malloc"); + } ulist[ulistsize++] = *u; } endutxent();