Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/netbsd-1-4]: src/sys/arch/i386/stand/lib pull up rev. 1.10 - avoid memor...



details:   https://anonhg.NetBSD.org/src/rev/9fe8fd0141a4
branches:  netbsd-1-4
changeset: 468143:9fe8fd0141a4
user:      drochner <drochner%NetBSD.org@localhost>
date:      Fri Apr 09 17:11:29 1999 +0000

description:
pull up rev. 1.10 - avoid memory leak if loadfile() fails

diffstat:

 sys/arch/i386/stand/lib/exec.c |  18 +++++++++++++-----
 1 files changed, 13 insertions(+), 5 deletions(-)

diffs (39 lines):

diff -r 3eb4910f120d -r 9fe8fd0141a4 sys/arch/i386/stand/lib/exec.c
--- a/sys/arch/i386/stand/lib/exec.c    Fri Apr 09 17:09:25 1999 +0000
+++ b/sys/arch/i386/stand/lib/exec.c    Fri Apr 09 17:11:29 1999 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: exec.c,v 1.9 1999/03/08 00:09:25 fvdl Exp $     */
+/*     $NetBSD: exec.c,v 1.9.2.1 1999/04/09 17:11:29 drochner Exp $     */
 
 /*
  * Copyright (c) 1982, 1986, 1990, 1993
@@ -112,10 +112,6 @@
 
        BI_ADD(&btinfo_console, BTINFO_CONSOLE, sizeof(struct btinfo_console));
 
-#ifdef PASS_BIOSGEOM
-       bi_getbiosgeom();
-#endif
-
        extmem = getextmem();
 
 #ifdef XMS
@@ -200,6 +196,18 @@
 
        close(fd);
 
+       /*
+        * Gather some information for the kernel. Do this after the
+        * "point of no return" to avoid memory leaks.
+        * (but before DOS might be trashed in the XMS case)
+        */
+#ifdef PASS_BIOSGEOM
+       bi_getbiosgeom();
+#endif
+#ifdef PASS_MEMMAP
+       bi_getmemmap();
+#endif
+
 #ifdef XMS
        if (loadaddr != origaddr) {
                /*



Home | Main Index | Thread Index | Old Index