diff options
author | brucec <brucec@FreeBSD.org> | 2010-11-29 11:55:17 +0000 |
---|---|---|
committer | brucec <brucec@FreeBSD.org> | 2010-11-29 11:55:17 +0000 |
commit | ebd34c6c2d5341cf5fa0e25984f85211807b8f65 (patch) | |
tree | bfd5f7251125b7af4499c6673d3ecd9f3714f763 /usr.sbin | |
parent | 5cd95b1421a2d5d5b0c7e02528f36c24be9d3ec3 (diff) | |
download | FreeBSD-src-ebd34c6c2d5341cf5fa0e25984f85211807b8f65.zip FreeBSD-src-ebd34c6c2d5341cf5fa0e25984f85211807b8f65.tar.gz |
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
Diffstat (limited to 'usr.sbin')
-rw-r--r-- | usr.sbin/sysinstall/modules.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/usr.sbin/sysinstall/modules.c b/usr.sbin/sysinstall/modules.c index 211c51e..e9bdb0f 100644 --- a/usr.sbin/sysinstall/modules.c +++ b/usr.sbin/sysinstall/modules.c @@ -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; |