Date: Mon, 29 Nov 2010 11:55:18 +0000 (UTC) From: Bruce Cran <brucec@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r216053 - head/usr.sbin/sysinstall Message-ID: <201011291155.oATBtIh7033836@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: brucec Date: Mon Nov 29 11:55:17 2010 New Revision: 216053 URL: http://svn.freebsd.org/changeset/base/216053 Log: 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 <cloud at madpowah.org> MFC after: 3 days Modified: head/usr.sbin/sysinstall/modules.c Modified: head/usr.sbin/sysinstall/modules.c ============================================================================== --- head/usr.sbin/sysinstall/modules.c Mon Nov 29 11:28:31 2010 (r216052) +++ head/usr.sbin/sysinstall/modules.c Mon Nov 29 11:55:17 2010 (r216053) @@ -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) { err = "Unable to set media device to floppy."; @@ -142,7 +143,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;
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201011291155.oATBtIh7033836>