From owner-svn-src-all@FreeBSD.ORG Thu Dec 2 09:10:45 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 C53D2106566B; Thu, 2 Dec 2010 09:10:45 +0000 (UTC) (envelope-from brucec@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B26498FC14; Thu, 2 Dec 2010 09:10:45 +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 oB29AjmF092473; Thu, 2 Dec 2010 09:10:45 GMT (envelope-from brucec@svn.freebsd.org) Received: (from brucec@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oB29Ajar092471; Thu, 2 Dec 2010 09:10:45 GMT (envelope-from brucec@svn.freebsd.org) Message-Id: <201012020910.oB29Ajar092471@svn.freebsd.org> From: Bruce Cran Date: Thu, 2 Dec 2010 09:10:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r216117 - stable/7/usr.sbin/sysinstall 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: Thu, 02 Dec 2010 09:10:45 -0000 Author: brucec Date: Thu Dec 2 09:10:45 2010 New Revision: 216117 URL: http://svn.freebsd.org/changeset/base/216117 Log: MFC r216053: If no floppy drive is installed kldBrowser() can generate an error early on. Initialize menu and count so the cleanup code doesn't try and use their uninitialized values. PR: bin/152270 Submitted by: Remi LAURENT Approved by: re (kensmith) Modified: stable/7/usr.sbin/sysinstall/modules.c Directory Properties: stable/7/usr.sbin/sysinstall/ (props changed) Modified: stable/7/usr.sbin/sysinstall/modules.c ============================================================================== --- stable/7/usr.sbin/sysinstall/modules.c Thu Dec 2 09:09:46 2010 (r216116) +++ stable/7/usr.sbin/sysinstall/modules.c Thu Dec 2 09:10:45 2010 (r216117) @@ -123,13 +123,14 @@ driverFloppyCheck(void) int kldBrowser(dialogMenuItem *self) { - DMenu *menu; + DMenu *menu = NULL; int i, what = DITEM_SUCCESS, msize, count; DIR *dir; struct dirent *de; char *err; err = NULL; + count = 0; if (DITEM_STATUS(mediaSetFloppy(NULL)) == DITEM_FAILURE) { msgConfirm("Unable to set media device to floppy."); @@ -146,7 +147,6 @@ kldBrowser(dialogMenuItem *self) } msize = sizeof(DMenu) + (sizeof(dialogMenuItem) * 2); - count = 0; if ((menu = malloc(msize)) == NULL) { err = "Failed to allocate memory for menu"; goto errout;