Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 9 Apr 2025 21:17:59 GMT
From:      Warner Losh <imp@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org
Subject:   git: ed1b3f13e72a - main - kboot: Free prior segs in init_avail()
Message-ID:  <202504092117.539LHxuA078170@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch main has been updated by imp:

URL: https://cgit.FreeBSD.org/src/commit/?id=ed1b3f13e72a53af1c68f0ae1cf359e4da7c6cf5

commit ed1b3f13e72a53af1c68f0ae1cf359e4da7c6cf5
Author:     Warner Losh <imp@FreeBSD.org>
AuthorDate: 2025-04-09 21:16:57 +0000
Commit:     Warner Losh <imp@FreeBSD.org>
CommitDate: 2025-04-09 21:16:57 +0000

    kboot: Free prior segs in init_avail()
    
    We can call init_avail() multiple times. Each time, we want to toss
    whatever garbage may have already been there from a prior failed attempt
    to find a good memory map.
    
    Sponsored by:           Netflix
---
 stand/kboot/libkboot/seg.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/stand/kboot/libkboot/seg.c b/stand/kboot/libkboot/seg.c
index 395c593bcabf..6979d5cfa5fd 100644
--- a/stand/kboot/libkboot/seg.c
+++ b/stand/kboot/libkboot/seg.c
@@ -20,6 +20,7 @@ init_avail(void)
 		free(segs);
 	nr_seg = 0;
 	segalloc = 16;
+	free(segs);
 	segs = malloc(sizeof(*segs) * segalloc);
 	if (segs == NULL)
 		panic("not enough memory to get memory map\n");



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202504092117.539LHxuA078170>