svn commit: r216117 - stable/7/usr.sbin/sysinstall
Bruce Cran
brucec at FreeBSD.org
Thu Dec 2 09:10:45 UTC 2010
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 <cloud at madpowah.org>
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;
More information about the svn-src-stable-7
mailing list