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
This commit is contained in:
@@ -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");
|
||||
|
||||
Reference in New Issue
Block a user