1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-18 10:35:55 +00:00

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
This commit is contained in:
Rebecca Cran 2010-11-29 11:55:17 +00:00
parent b7597cbfd5
commit 378b528ba0
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=216053

View File

@ -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;