From cfd87522afac0154821c511e87ff796ea85e2ba1 Mon Sep 17 00:00:00 2001 From: okuji Date: Tue, 25 May 1999 21:41:50 +0000 Subject: [PATCH] Fix a memory leak in /sbin/grub. --- ChangeLog | 5 +++++ docs/grub.texi | 4 ++-- grub/asmstub.c | 6 +++++- 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 3c3079d28..a083d9fb4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +1999-05-25 OKUJI Yoshinori + + * grub/asmstub.c (grub_stage2): Fix a memory leak that FP is + not closed. + 1999-05-25 OKUJI Yoshinori * grub/main.c: Replace OPT_DISABLE_CONFIG_FILE and diff --git a/docs/grub.texi b/docs/grub.texi index 8b28727ed..857c5772b 100644 --- a/docs/grub.texi +++ b/docs/grub.texi @@ -191,8 +191,8 @@ Rich functionality for OS experts/designers. @item Compatibility for booting FreeBSD, NetBSD, OpenBSD, and -Linux. Proprietary OS's such as DOS, Windows NT, and OS/2 are supported -via a chain-loading function. +GNU/Linux. Proprietary OS's such as DOS, Windows NT, and OS/2 are +supported via a chain-loading function. @end itemize Except for specific compatibility modes (chain-loading and the Linux diff --git a/grub/asmstub.c b/grub/asmstub.c index c241688fe..844a05b28 100644 --- a/grub/asmstub.c +++ b/grub/asmstub.c @@ -152,8 +152,12 @@ grub_stage2 (void) break; /* Attempt to read the first sector. */ if (fread (buf, 1, 512, fp) != 512) - break; + { + fclose (fp); + break; + } + fclose (fp); device_map[i + 0x80] = strdup (name); } first_scsi_disk = i + 0x80;